summaryrefslogtreecommitdiffstats
path: root/fs/notify/fdinfo.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2015-09-05 00:43:03 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2015-09-05 01:54:41 +0200
commit3c53e514212455db9923c203694a72007558b48f (patch)
treea5693cbd4b4366d886df9da609b0c115bff32e44 /fs/notify/fdinfo.c
parentfs/notify: optimize inotify/fsnotify code for unwatched files (diff)
downloadlinux-3c53e514212455db9923c203694a72007558b48f.tar.xz
linux-3c53e514212455db9923c203694a72007558b48f.zip
fsnotify: fix check in inotify fdinfo printing
A check in inotify_fdinfo() checking whether mark is valid was always true due to a bug. Luckily we can never get to invalidated marks since we hold mark_mutex and invalidated marks get removed from the group list when they are invalidated under that mutex. Anyway fix the check to make code more future proof. Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/notify/fdinfo.c')
-rw-r--r--fs/notify/fdinfo.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/notify/fdinfo.c b/fs/notify/fdinfo.c
index 58b7cdb63da9..6b6f0d472ae8 100644
--- a/fs/notify/fdinfo.c
+++ b/fs/notify/fdinfo.c
@@ -76,7 +76,8 @@ 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);