public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: fdmanana@kernel.org
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 0/2] btrfs: fix a regression with concurrent DIO writes and fsync on the same fd
Date: Fri, 30 Aug 2024 00:09:35 +0100	[thread overview]
Message-ID: <cover.1724972506.git.fdmanana@suse.com> (raw)

From: Filipe Manana <fdmanana@suse.com>

Fix a recent regression when doing concurrent direct IO writes and fsync
using the same fd from multiple threads. This was reported recently by a
couple users when using QEMU, as well as syzbot. The fix is the first
patch in the series, the second one is just an improvement for some
assertions. Details in the change logs of each patch.

Filipe Manana (2):
  btrfs: fix race between direct IO write and fsync when using same fd
  btrfs: add and use helper to verify the calling task has locked the inode

 fs/btrfs/btrfs_inode.h  |  8 ++++++++
 fs/btrfs/ctree.h        |  1 -
 fs/btrfs/direct-io.c    | 16 +++-------------
 fs/btrfs/file.c         |  9 +++++++--
 fs/btrfs/ordered-data.c |  2 +-
 fs/btrfs/transaction.h  |  6 ++++++
 fs/btrfs/tree-log.c     |  2 +-
 fs/btrfs/verity.c       |  6 +++---
 fs/btrfs/xattr.c        |  2 +-
 9 files changed, 30 insertions(+), 22 deletions(-)

-- 
2.43.0


             reply	other threads:[~2024-08-29 23:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-29 23:09 fdmanana [this message]
2024-08-29 23:09 ` [PATCH 1/2] btrfs: fix race between direct IO write and fsync when using same fd fdmanana
2024-09-02 21:38   ` David Sterba
2024-08-29 23:09 ` [PATCH 2/2] btrfs: add and use helper to verify the calling task has locked the inode fdmanana
2024-09-03 15:50 ` [PATCH 0/2] btrfs: fix a regression with concurrent DIO writes and fsync on the same fd Josef Bacik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1724972506.git.fdmanana@suse.com \
    --to=fdmanana@kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox