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/quota.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/quota.c')
-rw-r--r-- | fs/bcachefs/quota.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/bcachefs/quota.c b/fs/bcachefs/quota.c index 8e272519ce0e..35b409e0f366 100644 --- a/fs/bcachefs/quota.c +++ b/fs/bcachefs/quota.c @@ -372,6 +372,7 @@ static int bch2_quota_init_type(struct bch_fs *c, enum quota_types type) if (ret) break; } + bch2_trans_iter_put(&trans, iter); return bch2_trans_exit(&trans) ?: ret; } @@ -449,6 +450,8 @@ int bch2_fs_quota_read(struct bch_fs *c) KEY_TYPE_QUOTA_NOCHECK); } } + bch2_trans_iter_put(&trans, iter); + return bch2_trans_exit(&trans) ?: ret; } @@ -739,7 +742,9 @@ static int bch2_set_quota_trans(struct btree_trans *trans, if (qdq->d_fieldmask & QC_INO_HARD) new_quota->v.c[Q_INO].hardlimit = cpu_to_le64(qdq->d_ino_hardlimit); - return bch2_trans_update(trans, iter, &new_quota->k_i, 0); + ret = bch2_trans_update(trans, iter, &new_quota->k_i, 0); + bch2_trans_iter_put(trans, iter); + return ret; } static int bch2_set_quota(struct super_block *sb, struct kqid qid, |