Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
btrfs: zoned: fix parallel compressed writes
When multiple processes write data to the same block group on a compressed zoned filesystem, the underlying device could report I/O errors and data corruption is possible. This happens because on a zoned file system, compressed data writes where sent to the device via a REQ_OP_WRITE instead of a REQ_OP_ZONE_APPEND operation. But with REQ_OP_WRITE and parallel submission it cannot be guaranteed that the data is always submitted aligned to the underlying zone's write pointer. The change to using REQ_OP_ZONE_APPEND instead of REQ_OP_WRITE on a zoned filesystem is non intrusive on a regular file system or when submitting to a conventional zone on a zoned filesystem, as it is guarded by btrfs_use_zone_append. Reported-by: David Sterba <[email protected]> Fixes: 9d294a6 ("btrfs: zoned: enable to mount ZONED incompat flag") CC: [email protected] # 5.12.x: e380adf: btrfs: zoned: pass start block to btrfs_use_zone_append CC: [email protected] # 5.12.x Signed-off-by: Johannes Thumshirn <[email protected]> Signed-off-by: David Sterba <[email protected]>
- Loading branch information