Skip to content

Commit fdf9a37

Browse files
Christoph Hellwigkdave
authored andcommitted
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>
1 parent 921603c commit fdf9a37

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

fs/btrfs/zoned.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1641,6 +1641,9 @@ bool btrfs_use_zone_append(struct btrfs_bio *bbio)
16411641
if (!is_data_inode(&inode->vfs_inode))
16421642
return false;
16431643

1644+
if (btrfs_op(&bbio->bio) != BTRFS_MAP_WRITE)
1645+
return false;
1646+
16441647
/*
16451648
* Using REQ_OP_ZONE_APPNED for relocation can break assumptions on the
16461649
* extent layout the relocation code has.

0 commit comments

Comments
 (0)