From: Boris Burkov <boris@bur.io>
To: linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: [PATCH v2 0/2] btrfs: dio partial write corruption fix
Date: Tue, 21 Feb 2023 16:49:58 -0800 [thread overview]
Message-ID: <cover.1677026757.git.boris@bur.io> (raw)
If there is a page fault while btrfs reads the write buffer for a dio
write, then iomap will issue a partial bio which ultimately results in
an effective hole in the btrfs representation of the file. If what was
being written was not zeros, this means incorrect file contents.
The patch series consists of a prep patch creating a new ordered extent
allocation function and the business patch, which contains the fix
as well as the gory details of the bug itself.
---
Changelog:
v2:
- rename new ordered extent function
- pull the new function into a prep patch
- reorganize how the ordered_extent is stored/passed around to avoid so
many annoying memsets and exposing it to fs/btrfs/file.c
- lots of small code style improvements
- remove unintentional whitespace changes
- commit message improvements
- various ASSERTs for clarity/debugging
Boris Burkov (2):
btrfs: btrfs_alloc_ordered_extent
btrfs: fix dio continue after short write due to buffer page fault
fs/btrfs/btrfs_inode.h | 1 +
fs/btrfs/file.c | 11 +++++-
fs/btrfs/inode.c | 75 ++++++++++++++++++++++++++++++-----------
fs/btrfs/ordered-data.c | 45 ++++++++++++++++++++-----
fs/btrfs/ordered-data.h | 7 +++-
5 files changed, 109 insertions(+), 30 deletions(-)
--
2.38.1
next reply other threads:[~2023-02-22 0:50 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-22 0:49 Boris Burkov [this message]
2023-02-22 0:49 ` [PATCH v2 1/2] btrfs: btrfs_alloc_ordered_extent Boris Burkov
2023-02-22 11:52 ` Filipe Manana
2023-02-22 14:35 ` Christoph Hellwig
2023-02-22 0:50 ` [PATCH v2 2/2] btrfs: fix dio continue after short write due to buffer page fault Boris Burkov
2023-02-22 11:51 ` Filipe Manana
2023-02-22 11:54 ` Filipe Manana
2023-02-22 14:39 ` Christoph Hellwig
2023-02-23 19:48 ` David Sterba
2023-02-22 14:37 ` Christoph Hellwig
2023-03-06 23:07 ` Wang Yugui
2023-03-06 23:59 ` Boris Burkov
2023-03-07 22:01 ` Sweet Tea Dorminy
2023-03-07 22:00 ` Boris Burkov
2023-02-28 22:43 ` [PATCH v2 0/2] btrfs: dio partial write corruption fix David Sterba
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.1677026757.git.boris@bur.io \
--to=boris@bur.io \
--cc=kernel-team@fb.com \
--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;
as well as URLs for NNTP newsgroup(s).