summaryrefslogtreecommitdiff
path: root/fs/bcachefs/dirent.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-11-24 03:00:23 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:09:17 +0300
commit084d42bbd67c5b2de607f56a94c7295459b16b61 (patch)
tree91651bd4fbd44623acbe09bfca6d4e9a649cfc9f /fs/bcachefs/dirent.c
parent9ca4853b98af5fa15a2ddc47a45f8e103027f95d (diff)
downloadlinux-084d42bbd67c5b2de607f56a94c7295459b16b61.tar.xz
bcachefs: Apply workaround for too many btree iters to read path
Reading from cached data, which calls bch2_bucket_io_time_reset(), is leading to transaction iterator overflows - this standardizes the workaround. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/dirent.c')
-rw-r--r--fs/bcachefs/dirent.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/bcachefs/dirent.c b/fs/bcachefs/dirent.c
index 4dfcc955675b..fe4a85a6a8cb 100644
--- a/fs/bcachefs/dirent.c
+++ b/fs/bcachefs/dirent.c
@@ -531,10 +531,9 @@ retry:
* read_target looks up subvolumes, we can overflow paths if the
* directory has many subvolumes in it
*/
- if (hweight64(trans.paths_allocated) > BTREE_ITER_MAX / 2) {
- ret = -EINTR;
+ ret = btree_trans_too_many_iters(&trans);
+ if (ret)
break;
- }
}
bch2_trans_iter_exit(&trans, &iter);
err: