diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2018-07-21 04:23:42 +0200 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 23:08:07 +0200 |
commit | 19ee5f2ac4b34658b417073f4edc27ade11a01ae (patch) | |
tree | 9ceddf24dbc23766c66db4ed65aa8234b56271e5 /fs/bcachefs/acl.c | |
parent | bcachefs: bch2_trans_update() now takes struct btree_insert_entry (diff) | |
download | linux-19ee5f2ac4b34658b417073f4edc27ade11a01ae.tar.xz linux-19ee5f2ac4b34658b417073f4edc27ade11a01ae.zip |
bcachefs: Use ei_update_lock consistently
This is prep work for using deferred btree updates for inode updates -
the way inodes are done now we're relying on btree locking for ei_inode
and ei_update_lock could probably be removed, but it'll actually be
needed when we switch to deferred updates.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/acl.c')
-rw-r--r-- | fs/bcachefs/acl.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/bcachefs/acl.c b/fs/bcachefs/acl.c index c81e5365ec84..2856736f7224 100644 --- a/fs/bcachefs/acl.c +++ b/fs/bcachefs/acl.c @@ -304,13 +304,14 @@ int bch2_set_acl(struct mnt_idmap *idmap, umode_t mode = inode->v.i_mode; int ret; + mutex_lock(&inode->ei_update_lock); + bch2_trans_init(&trans, c); + if (type == ACL_TYPE_ACCESS && acl) { ret = posix_acl_update_mode(idmap, &inode->v, &mode, &acl); if (ret) - return ret; + goto err; } - - bch2_trans_init(&trans, c); retry: bch2_trans_begin(&trans); @@ -336,6 +337,7 @@ retry: set_cached_acl(&inode->v, type, acl); err: bch2_trans_exit(&trans); + mutex_unlock(&inode->ei_update_lock); return ret; } |