aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabian Frederick <fabf@skynet.be>2015-04-16 15:47:04 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-17 09:04:05 -0400
commit73d28d571d09082e132340ae4ad4d973211b7668 (patch)
treeeef2a693454fbae39c9ff780fb73885ddbffe26e
parent5e61473ea9f1ed6537ffaf6bf1cb60655f0d1b2c (diff)
fs/hfsplus: atomically set inode->i_flags
According to commit 5f16f3225b06 ("ext4: atomically set inode->i_flags in ext4_set_inode_flags()"). Signed-off-by: Fabian Frederick <fabf@skynet.be> Cc: "Theodore Ts'o" <tytso@mit.edu> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--fs/hfsplus/ioctl.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/fs/hfsplus/ioctl.c b/fs/hfsplus/ioctl.c
index d3ff5cc317d7..8e98f5db6ad6 100644
--- a/fs/hfsplus/ioctl.c
+++ b/fs/hfsplus/ioctl.c
@@ -76,7 +76,7 @@ static int hfsplus_ioctl_setflags(struct file *file, int __user *user_flags)
76{ 76{
77 struct inode *inode = file_inode(file); 77 struct inode *inode = file_inode(file);
78 struct hfsplus_inode_info *hip = HFSPLUS_I(inode); 78 struct hfsplus_inode_info *hip = HFSPLUS_I(inode);
79 unsigned int flags; 79 unsigned int flags, new_fl = 0;
80 int err = 0; 80 int err = 0;
81 81
82 err = mnt_want_write_file(file); 82 err = mnt_want_write_file(file);
@@ -110,14 +110,12 @@ static int hfsplus_ioctl_setflags(struct file *file, int __user *user_flags)
110 } 110 }
111 111
112 if (flags & FS_IMMUTABLE_FL) 112 if (flags & FS_IMMUTABLE_FL)
113 inode->i_flags |= S_IMMUTABLE; 113 new_fl |= S_IMMUTABLE;
114 else
115 inode->i_flags &= ~S_IMMUTABLE;
116 114
117 if (flags & FS_APPEND_FL) 115 if (flags & FS_APPEND_FL)
118 inode->i_flags |= S_APPEND; 116 new_fl |= S_APPEND;
119 else 117
120 inode->i_flags &= ~S_APPEND; 118 inode_set_flags(inode, new_fl, S_IMMUTABLE | S_APPEND);
121 119
122 if (flags & FS_NODUMP_FL) 120 if (flags & FS_NODUMP_FL)
123 hip->userflags |= HFSPLUS_FLG_NODUMP; 121 hip->userflags |= HFSPLUS_FLG_NODUMP;