Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

btrfs: also add stripe entries for NOCOW writes

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 do NOCOW writes for RAID stripe-tree filesystems.

Reviewed-by: Naohiro Aota <naohiro.aota@wdc.com>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>

authored by

Johannes Thumshirn and committed by
David Sterba
97f97822 96c6ca71

+5
+5
fs/btrfs/inode.c
··· 3111 3111 ret = btrfs_update_inode_fallback(trans, inode); 3112 3112 if (ret) /* -ENOMEM or corruption */ 3113 3113 btrfs_abort_transaction(trans, ret); 3114 + 3115 + ret = btrfs_insert_raid_extent(trans, ordered_extent); 3116 + if (ret) 3117 + btrfs_abort_transaction(trans, ret); 3118 + 3114 3119 goto out; 3115 3120 } 3116 3121