diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2025-01-16 03:57:22 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2025-03-06 18:15:01 -0500 |
commit | 9d9adc2fc1833dc746aed6ffd39359eb5892d208 (patch) | |
tree | aa85247039865e21963f9875186f692a3270feeb | |
parent | 7b1133005564e9986771088c7a438f58f339dcf0 (diff) |
bcachefs: Avoid holding btree locks when blocking on IO
Read retries are done synchronously, so we definitely shouldn't be
holding any locks (even the srcu lock for btree key cache reclaim) when
submitting the IO.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r-- | fs/bcachefs/io_read.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/bcachefs/io_read.c b/fs/bcachefs/io_read.c index 233bcf50fd1a..fe45041400e3 100644 --- a/fs/bcachefs/io_read.c +++ b/fs/bcachefs/io_read.c @@ -955,7 +955,10 @@ retry_pick: * Unlock the iterator while the btree node's lock is still in * cache, before doing the IO: */ - bch2_trans_unlock(trans); + if (!(flags & BCH_READ_IN_RETRY)) + bch2_trans_unlock(trans); + else + bch2_trans_unlock_long(trans); if (flags & BCH_READ_NODECODE) { /* |