summaryrefslogtreecommitdiff
path: root/fs/bcachefs/fs-common.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-07-24 19:50:40 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:09 -0400
commit8b3e9bd65f61dde939538452cbb2a608bc562d34 (patch)
tree57914926543d42d97d092e75618ed32d4cb8ba37 /fs/bcachefs/fs-common.c
parent67b07638f1fab974284846d77cce771fed88ded3 (diff)
bcachefs: Always check for transaction restarts
On transaction restart iterators won't be locked anymore - make sure we're always checking for errors. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/fs-common.c')
-rw-r--r--fs/bcachefs/fs-common.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/bcachefs/fs-common.c b/fs/bcachefs/fs-common.c
index 60c54438074e..2189a11ccad8 100644
--- a/fs/bcachefs/fs-common.c
+++ b/fs/bcachefs/fs-common.c
@@ -168,6 +168,10 @@ int bch2_unlink_trans(struct btree_trans *trans,
goto err;
k = bch2_btree_iter_peek_slot(dirent_iter);
+ ret = bkey_err(k);
+ if (ret)
+ goto err;
+
inum = le64_to_cpu(bkey_s_c_to_dirent(k).v->d_inum);
inode_iter = bch2_inode_peek(trans, inode_u, inum, BTREE_ITER_INTENT);