bcachefs: Fix excess transaction restarts in __bchfs_fallocate()
authorKent Overstreet <kent.overstreet@linux.dev>
Tue, 16 Jan 2024 01:37:23 +0000 (20:37 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 21 Jan 2024 18:27:10 +0000 (13:27 -0500)
commit46bf2e9cc745996ca56e56ed816e60d07811bd9a
tree94858ccb5646f0629924d68761471e24b67433df
parent1a5039041b376f545dfc11d89af77cc720217b44
bcachefs: Fix excess transaction restarts in __bchfs_fallocate()

drop_locks_do() should not be used in a fastpath without first trying
the do in nonblocking mode - the unlock and relock will cause excessive
transaction restarts and potentially livelocking with other threads that
are contending for the same locks.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/btree_iter.h
fs/bcachefs/fs-io-pagecache.c
fs/bcachefs/fs-io-pagecache.h
fs/bcachefs/fs-io.c