public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs: also add stripe entries for NOCOW writes
@ 2024-09-23  6:45 Johannes Thumshirn
  2024-09-23  7:28 ` Qu Wenruo
  2024-09-24  7:07 ` Naohiro Aota
  0 siblings, 2 replies; 12+ messages in thread
From: Johannes Thumshirn @ 2024-09-23  6:45 UTC (permalink / raw)
  To: Chris Mason, Josef Bacik, David Sterba,
	open list:BTRFS FILE SYSTEM, open list
  Cc: Qu Wenruo, Naohiro Aota, Johannes Thumshirn

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


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

end of thread, other threads:[~2024-09-24  7:07 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-23  6:45 [PATCH] btrfs: also add stripe entries for NOCOW writes Johannes Thumshirn
2024-09-23  7:28 ` 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

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