diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-12-05 00:30:49 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:18 -0400 |
commit | 94a3e1a6c1bd441b58972ee0216593fc0b09ee75 (patch) | |
tree | c1c51180768769af2f00c7653122329c85b4f93c /fs/bcachefs/dirent.c | |
parent | 1d81313f22205bfd844bd2e13e7e3ea5d50cd673 (diff) | |
download | linux-94a3e1a6c1bd441b58972ee0216593fc0b09ee75.tar.gz linux-94a3e1a6c1bd441b58972ee0216593fc0b09ee75.tar.bz2 linux-94a3e1a6c1bd441b58972ee0216593fc0b09ee75.zip |
bcachefs: bch2_trans_update() is now __must_check
With snapshots, bch2_trans_update() has to check if we need a whitout,
which can cause a transaction restart, so this is important now.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/dirent.c')
-rw-r--r-- | fs/bcachefs/dirent.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/bcachefs/dirent.c b/fs/bcachefs/dirent.c index fe4a85a6a8cb..a165d08c3668 100644 --- a/fs/bcachefs/dirent.c +++ b/fs/bcachefs/dirent.c @@ -367,7 +367,9 @@ int bch2_dirent_rename(struct btree_trans *trans, } } - bch2_trans_update(trans, &dst_iter, &new_dst->k_i, 0); + ret = bch2_trans_update(trans, &dst_iter, &new_dst->k_i, 0); + if (ret) + goto out; out_set_src: /* @@ -384,7 +386,9 @@ out_set_src: src_update_flags |= BTREE_UPDATE_INTERNAL_SNAPSHOT_NODE; } - bch2_trans_update(trans, &src_iter, &new_src->k_i, src_update_flags); + ret = bch2_trans_update(trans, &src_iter, &new_src->k_i, src_update_flags); + if (ret) + goto out; if (mode == BCH_RENAME_EXCHANGE) *src_offset = new_src->k.p.offset; |