[Devel] [PATCH rh7] fsnotify: fix check in inotify fdinfo printing
Cyrill Gorcunov
gorcunov at odin.com
Fri Nov 20 07:43:09 PST 2015
ML: 3c53e514212455db9923c203694a72007558b48f
From: Jan Kara <jack at suse.cz>
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 at suse.cz>
Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
Just to make code clear.
fs/notify/fdinfo.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Index: linux-pcs7.git/fs/notify/fdinfo.c
===================================================================
--- linux-pcs7.git.orig/fs/notify/fdinfo.c
+++ linux-pcs7.git/fs/notify/fdinfo.c
@@ -79,7 +79,8 @@ static int inotify_fdinfo(struct seq_fil
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 0;
inode_mark = container_of(mark, struct inotify_inode_mark, fsn_mark);
More information about the Devel
mailing list