Skip to content

Commit f3da882

Browse files
morbidrsakdave
authored andcommitted
btrfs: zoned: remove outdated WARN_ON in direct IO
In btrfs_submit_direct() there's a WAN_ON_ONCE() that will trigger if we're submitting a DIO write on a zoned filesystem but are not using REQ_OP_ZONE_APPEND to submit the IO to the block device. This is a left over from a previous version where btrfs_dio_iomap_begin() didn't use btrfs_use_zone_append() to check for sequential write only zones. It is an oversight from the development phase. In v11 (I think) I've added 08f4555 ("btrfs: zoned: cache if block group is on a sequential zone") and forgot to remove the WARN_ON_ONCE() for 544d24f ("btrfs: zoned: enable zone append writing for direct IO"). When developing auto relocation I got hit by the WARN as a block groups where relocated to conventional zone and the dio code calls btrfs_use_zone_append() introduced by 08f4555 to check if it can use zone append (a.k.a. if it's a sequential zone) or not and sets the appropriate flags for iomap. I've never hit it in testing before, as I was relying on emulation to test the conventional zones code but this one case wasn't hit, because on emulation fs_info->max_zone_append_size is 0 and the WARN doesn't trigger either. Fixes: 544d24f ("btrfs: zoned: enable zone append writing for direct IO") Signed-off-by: Johannes Thumshirn <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 485df75 commit f3da882

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

fs/btrfs/inode.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8166,10 +8166,6 @@ static blk_qc_t btrfs_submit_direct(struct inode *inode, struct iomap *iomap,
81668166
bio->bi_end_io = btrfs_end_dio_bio;
81678167
btrfs_io_bio(bio)->logical = file_offset;
81688168

8169-
WARN_ON_ONCE(write && btrfs_is_zoned(fs_info) &&
8170-
fs_info->max_zone_append_size &&
8171-
bio_op(bio) != REQ_OP_ZONE_APPEND);
8172-
81738169
if (bio_op(bio) == REQ_OP_ZONE_APPEND) {
81748170
status = extract_ordered_extent(BTRFS_I(inode), bio,
81758171
file_offset);

0 commit comments

Comments
 (0)