xfs
[Top] [All Lists]

[PATCH 2/5] fs: Fix WARN_ON in inode_set_mask()

To: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
Subject: [PATCH 2/5] fs: Fix WARN_ON in inode_set_mask()
From: Jan Kara <jack@xxxxxxx>
Date: Thu, 4 Dec 2014 14:27:36 +0100
Cc: linux-fsdevel@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx, linux-security-module@xxxxxxxxxxxxxxx, Jan Kara <jack@xxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1417699659-14284-1-git-send-email-jack@xxxxxxx>
References: <1417699659-14284-1-git-send-email-jack@xxxxxxx>
WARN_ON in inode_set_mask() warns if we don't clear all bits we are
setting instead of reverse - warning when caller requests setting and
clearing of the same bit.

Signed-off-by: Jan Kara <jack@xxxxxxx>
---
 fs/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/inode.c b/fs/inode.c
index fcc0886c5824..3490389dc813 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -1923,7 +1923,7 @@ void inode_set_flags(struct inode *inode, unsigned int 
flags,
 {
        unsigned int old_flags, new_flags;
 
-       WARN_ON_ONCE(flags & ~mask);
+       WARN_ON_ONCE(flags & mask);
        do {
                old_flags = ACCESS_ONCE(inode->i_flags);
                new_flags = (old_flags & ~mask) | flags;
-- 
1.8.1.4

<Prev in Thread] Current Thread [Next in Thread>