From: Fabian Frederick Date: Thu, 16 Apr 2015 19:47:04 +0000 (-0700) Subject: fs/hfsplus: atomically set inode->i_flags X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=73d28d571d09082e132340ae4ad4d973211b7668;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Cc: "Theodore Ts'o" Cc: Al Viro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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) { struct inode *inode = file_inode(file); struct hfsplus_inode_info *hip = HFSPLUS_I(inode); - unsigned int flags; + unsigned int flags, new_fl = 0; int err = 0; err = mnt_want_write_file(file); @@ -110,14 +110,12 @@ static int hfsplus_ioctl_setflags(struct file *file, int __user *user_flags) } if (flags & FS_IMMUTABLE_FL) - inode->i_flags |= S_IMMUTABLE; - else - inode->i_flags &= ~S_IMMUTABLE; + new_fl |= S_IMMUTABLE; if (flags & FS_APPEND_FL) - inode->i_flags |= S_APPEND; - else - inode->i_flags &= ~S_APPEND; + new_fl |= S_APPEND; + + inode_set_flags(inode, new_fl, S_IMMUTABLE | S_APPEND); if (flags & FS_NODUMP_FL) hip->userflags |= HFSPLUS_FLG_NODUMP;