ML: 3c53e514212455db9923c203694a72007558b48f

From: Jan Kara <j...@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 <j...@suse.cz>
Signed-off-by: Andrew Morton <a...@linux-foundation.org>
Signed-off-by: Linus Torvalds <torva...@linux-foundation.org>
Signed-off-by: Cyrill Gorcunov <gorcu...@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);
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to