diff options
author | Christoph Hellwig <hch@lst.de> | 2022-12-12 10:37:22 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2023-02-15 21:38:55 +0300 |
commit | fdf9a37dcfd47e9bd18d1218f2d0b2fa3748d00d (patch) | |
tree | 6db3e2a618c2850ba6a5f20db32a92cf169d610f | |
parent | 921603c76246a7f716b9a244d7b1fa1653935f31 (diff) | |
download | linux-fdf9a37dcfd47e9bd18d1218f2d0b2fa3748d00d.tar.xz |
btrfs: never return true for reads in btrfs_use_zone_append
Using Zone Append only makes sense for writes to the device, so check
that in btrfs_use_zone_append. This avoids the possibility of
artificially limited read size on zoned file systems.
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r-- | fs/btrfs/zoned.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c index 8824748ee8c3..442bb79ffd08 100644 --- a/fs/btrfs/zoned.c +++ b/fs/btrfs/zoned.c @@ -1641,6 +1641,9 @@ bool btrfs_use_zone_append(struct btrfs_bio *bbio) if (!is_data_inode(&inode->vfs_inode)) return false; + if (btrfs_op(&bbio->bio) != BTRFS_MAP_WRITE) + return false; + /* * Using REQ_OP_ZONE_APPNED for relocation can break assumptions on the * extent layout the relocation code has. |