According to commit 5f16f3225b0624

ext4: atomically set inode->i_flags in ext4_set_inode_flags()

Inspired-by: "Theodore Ts'o" <ty...@mit.edu>
Cc: Artem Bityutskiy <dedeki...@gmail.com>
Cc: Adrian Hunter <adrian.hun...@intel.com>
Cc: "Theodore Ts'o" <ty...@mit.edu>
Signed-off-by: Fabian Frederick <f...@skynet.be>
---
 fs/ubifs/ioctl.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/fs/ubifs/ioctl.c b/fs/ubifs/ioctl.c
index 648b143..26f416e 100644
--- a/fs/ubifs/ioctl.c
+++ b/fs/ubifs/ioctl.c
@@ -37,16 +37,18 @@
 void ubifs_set_inode_flags(struct inode *inode)
 {
        unsigned int flags = ubifs_inode(inode)->flags;
+       unsigned int new_fl = 0;
 
-       inode->i_flags &= ~(S_SYNC | S_APPEND | S_IMMUTABLE | S_DIRSYNC);
        if (flags & UBIFS_SYNC_FL)
-               inode->i_flags |= S_SYNC;
+               new_fl |= S_SYNC;
        if (flags & UBIFS_APPEND_FL)
-               inode->i_flags |= S_APPEND;
+               new_fl |= S_APPEND;
        if (flags & UBIFS_IMMUTABLE_FL)
-               inode->i_flags |= S_IMMUTABLE;
+               new_fl |= S_IMMUTABLE;
        if (flags & UBIFS_DIRSYNC_FL)
-               inode->i_flags |= S_DIRSYNC;
+               new_fl |= S_DIRSYNC;
+       inode_set_flags(inode, new_fl, S_SYNC | S_APPEND | S_IMMUTABLE |
+                       S_DIRSYNC);
 }
 
 /*
-- 
1.8.4.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to