diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-03-19 20:29:11 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:56 -0400 |
commit | 50dc0f692a0dbe3e6a95d3f8e5c7e718bc9f021d (patch) | |
tree | 5d0dcdb49c81ebd54e59c4c9cc1f379994262a48 /fs/bcachefs/migrate.c | |
parent | 8d956c2fb8f7e91370fea1d27d16c6869b8ada78 (diff) | |
download | linux-stable-50dc0f692a0dbe3e6a95d3f8e5c7e718bc9f021d.tar.gz linux-stable-50dc0f692a0dbe3e6a95d3f8e5c7e718bc9f021d.tar.bz2 linux-stable-50dc0f692a0dbe3e6a95d3f8e5c7e718bc9f021d.zip |
bcachefs: Require all btree iterators to be freed
We keep running into occasional bugs with btree transaction iterators
overflowing - this will make those bugs more visible.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/migrate.c')
-rw-r--r-- | fs/bcachefs/migrate.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/bcachefs/migrate.c b/fs/bcachefs/migrate.c index 1db2c2d6b970..4d8b4169923d 100644 --- a/fs/bcachefs/migrate.c +++ b/fs/bcachefs/migrate.c @@ -88,6 +88,7 @@ static int __bch2_dev_usrdata_drop(struct bch_fs *c, unsigned dev_idx, int flags if (ret) break; } + bch2_trans_iter_put(&trans, iter); ret = bch2_trans_exit(&trans) ?: ret; bch2_bkey_buf_exit(&sk, c); @@ -135,20 +136,24 @@ retry: dev_idx, flags, true); if (ret) { bch_err(c, "Cannot drop device without losing data"); - goto err; + break; } ret = bch2_btree_node_update_key(c, iter, b, k.k); if (ret == -EINTR) { b = bch2_btree_iter_peek_node(iter); + ret = 0; goto retry; } if (ret) { bch_err(c, "Error updating btree node key: %i", ret); - goto err; + break; } } bch2_trans_iter_free(&trans, iter); + + if (ret) + goto err; } /* flush relevant btree updates */ |