[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20140417175459.6cbd49e16ce30724b7638607@skynet.be>
Date: Thu, 17 Apr 2014 17:54:59 +0200
From: Fabian Frederick <fabf@...net.be>
To: linux-kernel <linux-kernel@...r.kernel.org>
Cc: Artem Bityutskiy <dedekind1@...il.com>,
Adrian Hunter <adrian.hunter@...el.com>, tytso <tytso@....edu>
Subject: [PATCH 1/1] fs/ubifs/ioctl.c: atomically set inode->i_flags
According to commit 5f16f3225b0624
ext4: atomically set inode->i_flags in ext4_set_inode_flags()
Inspired-by: "Theodore Ts'o" <tytso@....edu>
Cc: Artem Bityutskiy <dedekind1@...il.com>
Cc: Adrian Hunter <adrian.hunter@...el.com>
Cc: "Theodore Ts'o" <tytso@....edu>
Signed-off-by: Fabian Frederick <fabf@...net.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 majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists