From: Johannes Thumshirn <jth@kernel.org>
To: Chris Mason <clm@fb.com>, Josef Bacik <josef@toxicpanda.com>,
David Sterba <dsterba@suse.com>,
linux-btrfs@vger.kernel.org (open list:BTRFS FILE SYSTEM),
linux-kernel@vger.kernel.org (open list)
Cc: Qu Wenruo <wqu@suse.com>, Naohiro Aota <naohiro.aota@wdc.com>,
Johannes Thumshirn <johannes.thumshirn@wdc.com>
Subject: [PATCH] btrfs: also add stripe entries for NOCOW writes
Date: Mon, 23 Sep 2024 08:45:47 +0200 [thread overview]
Message-ID: <20240923064549.14224-1-jth@kernel.org> (raw)
From: Johannes Thumshirn <johannes.thumshirn@wdc.com>
NOCOW writes do not generate stripe_extent entries in the RAID stripe
tree, as the RAID stripe-tree feature initially was designed with a
zoned filesystem in mind and on a zoned filesystem, we do not allow NOCOW
writes. But the RAID stripe-tree feature is independent from the zoned
feature, so we must also allow NOCOW writes for zoned filesystems.
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
fs/btrfs/inode.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index edac499fd83d..c6e4b58c334c 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -3111,6 +3111,11 @@ int btrfs_finish_one_ordered(struct btrfs_ordered_extent *ordered_extent)
ret = btrfs_update_inode_fallback(trans, inode);
if (ret) /* -ENOMEM or corruption */
btrfs_abort_transaction(trans, ret);
+
+ ret = btrfs_insert_raid_extent(trans, ordered_extent);
+ if (ret)
+ btrfs_abort_transaction(trans, ret);
+
goto out;
}
--
2.43.0
next reply other threads:[~2024-09-23 6:46 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-23 6:45 Johannes Thumshirn [this message]
2024-09-23 7:28 ` [PATCH] btrfs: also add stripe entries for NOCOW writes Qu Wenruo
2024-09-23 7:40 ` Johannes Thumshirn
2024-09-23 7:56 ` Qu Wenruo
2024-09-23 8:15 ` Johannes Thumshirn
2024-09-23 8:53 ` Qu Wenruo
2024-09-23 14:41 ` Johannes Thumshirn
2024-09-23 22:23 ` Qu Wenruo
2024-09-23 15:20 ` Josef Bacik
2024-09-23 22:32 ` Qu Wenruo
2024-09-24 0:46 ` Qu Wenruo
2024-09-24 7:07 ` Naohiro Aota
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=20240923064549.14224-1-jth@kernel.org \
--to=jth@kernel.org \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=johannes.thumshirn@wdc.com \
--cc=josef@toxicpanda.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=naohiro.aota@wdc.com \
--cc=wqu@suse.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.