Skip to content

Commit 99fe7e5

Browse files
adam900710kdave
authored andcommitted
btrfs: remove the alignment check in end_bbio_data_write()
The check is not necessary because: - There is already assert_bbio_alignment() at btrfs_submit_bbio() - There is also btrfs_subpage_assert() for all btrfs_folio_*() helpers - The original commit mentions the check may go away in the future Commit 17a5adc ("btrfs: do away with non-whole_page extent I/O") introduced the check first, and in the commit message: I've replaced the whole_page computations with warnings, just to be sure that we're not issuing partial page reads or writes. The warnings should probably just go away some time. - No similar check in all other endio functions No matter if it's data read, compressed read or write. - There is no such report for very long I do not even remember if there is any such report. Thus the need to do such check in end_bbio_data_write() is very weak, and we can just get rid of it. Reviewed-by: David Sterba <[email protected]> Signed-off-by: Qu Wenruo <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent cc970d2 commit 99fe7e5

1 file changed

Lines changed: 0 additions & 11 deletions

File tree

fs/btrfs/extent_io.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,6 @@ static void end_bbio_data_write(struct btrfs_bio *bbio)
521521
struct bio *bio = &bbio->bio;
522522
int error = blk_status_to_errno(bio->bi_status);
523523
struct folio_iter fi;
524-
const u32 sectorsize = fs_info->sectorsize;
525524
u32 bio_size = 0;
526525

527526
ASSERT(!bio_flagged(bio, BIO_CLONED));
@@ -531,16 +530,6 @@ static void end_bbio_data_write(struct btrfs_bio *bbio)
531530
u32 len = fi.length;
532531

533532
bio_size += len;
534-
/* Our read/write should always be sector aligned. */
535-
if (!IS_ALIGNED(fi.offset, sectorsize))
536-
btrfs_err(fs_info,
537-
"partial page write in btrfs with offset %zu and length %zu",
538-
fi.offset, fi.length);
539-
else if (!IS_ALIGNED(fi.length, sectorsize))
540-
btrfs_info(fs_info,
541-
"incomplete page write with offset %zu and length %zu",
542-
fi.offset, fi.length);
543-
544533
if (error)
545534
mapping_set_error(folio->mapping, error);
546535

0 commit comments

Comments
 (0)