public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] btrfs: fix deadlock with fsync and full sync
@ 2022-06-13 19:09 Josef Bacik
  2022-06-13 19:09 ` [PATCH v2 1/2] btrfs: make the return value for log syncing consistent Josef Bacik
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Josef Bacik @ 2022-06-13 19:09 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

v1->v2:
- Make btrfs_sync_file also use the new BTRFS_LOG_FORCE_COMMIT define.
- Adjust the title of the second patch

--- Original email ---
Hello,

We've hit a pretty convoluted deadlock in production that Omar tracked down with
drgn.  I've described the deadlock in the second patch, but generally it's a
lock inversion where we have an existing dependency of extent lock ->
transaction, but in fsync in a few cases we can end up with transaction ->
extent lock, and the expected hilarity ensues.  Thanks,

Josef

Josef Bacik (2):
  btrfs: make the return value for log syncing consistent
  btrfs: fix deadlock with fsync+fiemap+transaction commit

 fs/btrfs/file.c     | 69 ++++++++++++++++++++++++++++++++++-----------
 fs/btrfs/tree-log.c | 18 ++++++------
 fs/btrfs/tree-log.h |  3 ++
 3 files changed, 65 insertions(+), 25 deletions(-)

-- 
2.26.3


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-06-14 13:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-13 19:09 [PATCH v2 0/2] btrfs: fix deadlock with fsync and full sync Josef Bacik
2022-06-13 19:09 ` [PATCH v2 1/2] btrfs: make the return value for log syncing consistent Josef Bacik
2022-06-13 19:09 ` [PATCH v2 2/2] btrfs: fix deadlock with fsync+fiemap+transaction commit Josef Bacik
2022-06-14  9:56 ` [PATCH v2 0/2] btrfs: fix deadlock with fsync and full sync Filipe Manana
2022-06-14 13:14 ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox