diff options
author | Anand Jain <anand.jain@oracle.com> | 2019-04-12 04:02:57 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2019-04-29 13:02:44 -0400 |
commit | 353c2ea735e4b54fb6250861e67b51b1bcb47198 (patch) | |
tree | 275cdb06503a91f3e451e7815f2e81eddf651503 | |
parent | 3e125a74fbc1938afd699ba9ba7f33801768bd0e (diff) |
btrfs: remove redundant readonly root check in btrfs_setxattr_trans
btrfs_setxattr_trans() is called by 5 functions as below and all of them
do updates. None of them would be roun on a read-only root.
So its ok to remove the readonly root check here as it's a high-level
conditon.
1.
__btrfs_set_acl()
btrfs_init_acl()
btrfs_init_inode_security()
2.
__btrfs_set_acl()
btrfs_set_acl()
3.
btrfs_set_prop()
btrfs_set_prop_trans()
/ \
btrfs_ioctl_setflags() btrfs_xattr_handler_set_prop()
4.
btrfs_xattr_handler_set()
5.
btrfs_initxattrs()
btrfs_xattr_security_init()
btrfs_init_inode_security()
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r-- | fs/btrfs/xattr.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/fs/btrfs/xattr.c b/fs/btrfs/xattr.c index b2b68676ec52..4c447b1f32e5 100644 --- a/fs/btrfs/xattr.c +++ b/fs/btrfs/xattr.c | |||
@@ -226,9 +226,6 @@ int btrfs_setxattr_trans(struct btrfs_trans_handle *trans, | |||
226 | struct btrfs_root *root = BTRFS_I(inode)->root; | 226 | struct btrfs_root *root = BTRFS_I(inode)->root; |
227 | int ret; | 227 | int ret; |
228 | 228 | ||
229 | if (btrfs_root_readonly(root)) | ||
230 | return -EROFS; | ||
231 | |||
232 | if (trans) | 229 | if (trans) |
233 | return btrfs_setxattr(trans, inode, name, value, size, flags); | 230 | return btrfs_setxattr(trans, inode, name, value, size, flags); |
234 | 231 | ||