These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / fs / notify / fdinfo.c
index 58b7cdb..fd98e51 100644 (file)
@@ -76,15 +76,23 @@ static void inotify_fdinfo(struct seq_file *m, struct fsnotify_mark *mark)
        struct inotify_inode_mark *inode_mark;
        struct inode *inode;
 
-       if (!(mark->flags & (FSNOTIFY_MARK_FLAG_ALIVE | FSNOTIFY_MARK_FLAG_INODE)))
+       if (!(mark->flags & FSNOTIFY_MARK_FLAG_ALIVE) ||
+           !(mark->flags & FSNOTIFY_MARK_FLAG_INODE))
                return;
 
        inode_mark = container_of(mark, struct inotify_inode_mark, fsn_mark);
        inode = igrab(mark->inode);
        if (inode) {
+               /*
+                * IN_ALL_EVENTS represents all of the mask bits
+                * that we expose to userspace.  There is at
+                * least one bit (FS_EVENT_ON_CHILD) which is
+                * used only internally to the kernel.
+                */
+               u32 mask = mark->mask & IN_ALL_EVENTS;
                seq_printf(m, "inotify wd:%x ino:%lx sdev:%x mask:%x ignored_mask:%x ",
                           inode_mark->wd, inode->i_ino, inode->i_sb->s_dev,
-                          mark->mask, mark->ignored_mask);
+                          mask, mark->ignored_mask);
                show_mark_fhandle(m, inode);
                seq_putc(m, '\n');
                iput(inode);