fanotify: Fix up scripted S_ISDIR/S_ISREG/S_ISLNK conversions
authorDavid Howells <dhowells@redhat.com>
Thu, 29 Jan 2015 12:02:36 +0000 (12:02 +0000)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 22 Feb 2015 16:38:42 +0000 (11:38 -0500)
Fanotify probably doesn't want to watch autodirs so make it use d_can_lookup()
rather than d_is_dir() when checking a dir watch and give an error on fake
directories.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/notify/fanotify/fanotify.c

index 61fdbb826324e2a20e5ad5877dea9b0772b0e995..9a66ff79ff2781d1c7992dbd3d4ec42a82008f59 100644 (file)
@@ -116,7 +116,7 @@ static bool fanotify_should_send_event(struct fsnotify_mark *inode_mark,
 
        /* sorry, fanotify only gives a damn about files and dirs */
        if (!d_is_reg(path->dentry) &&
-           !d_is_dir(path->dentry))
+           !d_can_lookup(path->dentry))
                return false;
 
        if (inode_mark && vfsmnt_mark) {