diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2019-12-21 00:35:24 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:08:33 +0300 |
commit | a8abd3a7f63efe4a366ae5aba10b2466feba39d7 (patch) | |
tree | ea1d23cd85f294ca2ea459949f495f207978d8e6 /fs/bcachefs/reflink.c | |
parent | 780c4e43f8f8986bb8d97d654cb17edd0dfca4b4 (diff) | |
download | linux-a8abd3a7f63efe4a366ae5aba10b2466feba39d7.tar.xz |
bcachefs: bch2_trans_reset() calls should be at the tops of loops
It needs to be called when we get -EINTR due to e.g. lock restart - this
fixes a transaction iterators overflow bug.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/reflink.c')
-rw-r--r-- | fs/bcachefs/reflink.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/bcachefs/reflink.c b/fs/bcachefs/reflink.c index 53bd0e0ea058..a65ada691ba1 100644 --- a/fs/bcachefs/reflink.c +++ b/fs/bcachefs/reflink.c @@ -185,7 +185,8 @@ s64 bch2_remap_range(struct bch_fs *c, BTREE_ITER_INTENT); while (1) { - bch2_trans_begin_updates(&trans); + bch2_trans_reset(&trans, TRANS_RESET_MEM); + trans.mem_top = 0; if (fatal_signal_pending(current)) { |