diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-06-19 21:12:05 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:10:04 -0400 |
commit | a83e108fc1964b8273c6f51cc62588ee774a5a48 (patch) | |
tree | e7dfa78b72f5f20624a8e350a0e50417799fc338 /fs/bcachefs/fs.c | |
parent | a5b696ee6e10103def82ea9abc18958912e81b00 (diff) | |
download | linux-a83e108fc1964b8273c6f51cc62588ee774a5a48.tar.gz linux-a83e108fc1964b8273c6f51cc62588ee774a5a48.tar.bz2 linux-a83e108fc1964b8273c6f51cc62588ee774a5a48.zip |
bcachefs: fiemap: Fix a lockdep splat
As with the previous patch, we generally can't hold btree locks while
copying to userspace, as that may incur a page fault and require
mmap_lock.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/fs.c')
-rw-r--r-- | fs/bcachefs/fs.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c index f417889eba08..9280f514bc9f 100644 --- a/fs/bcachefs/fs.c +++ b/fs/bcachefs/fs.c @@ -943,6 +943,7 @@ retry: cur.k->k.p.offset += cur.k->k.size; if (have_extent) { + bch2_trans_unlock(&trans); ret = bch2_fill_extent(c, info, bkey_i_to_s_c(prev.k), 0); if (ret) @@ -961,9 +962,11 @@ err: if (bch2_err_matches(ret, BCH_ERR_transaction_restart)) goto retry; - if (!ret && have_extent) + if (!ret && have_extent) { + bch2_trans_unlock(&trans); ret = bch2_fill_extent(c, info, bkey_i_to_s_c(prev.k), FIEMAP_EXTENT_LAST); + } bch2_trans_exit(&trans); bch2_bkey_buf_exit(&cur, c); |