diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-11-23 19:00:23 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:17 -0400 |
commit | 084d42bbd67c5b2de607f56a94c7295459b16b61 (patch) | |
tree | 91651bd4fbd44623acbe09bfca6d4e9a649cfc9f /fs/bcachefs/dirent.c | |
parent | 9ca4853b98af5fa15a2ddc47a45f8e103027f95d (diff) | |
download | linux-084d42bbd67c5b2de607f56a94c7295459b16b61.tar.gz linux-084d42bbd67c5b2de607f56a94c7295459b16b61.tar.bz2 linux-084d42bbd67c5b2de607f56a94c7295459b16b61.zip |
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.c | 5 |
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: |