Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 17a5adccf3fd01 ("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 <dsterba@suse.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>

authored by

Qu Wenruo and committed by
David Sterba
99fe7e57 cc970d21

-11
-11
fs/btrfs/extent_io.c
··· 521 521 struct bio *bio = &bbio->bio; 522 522 int error = blk_status_to_errno(bio->bi_status); 523 523 struct folio_iter fi; 524 - const u32 sectorsize = fs_info->sectorsize; 525 524 u32 bio_size = 0; 526 525 527 526 ASSERT(!bio_flagged(bio, BIO_CLONED)); ··· 530 531 u32 len = fi.length; 531 532 532 533 bio_size += len; 533 - /* Our read/write should always be sector aligned. */ 534 - if (!IS_ALIGNED(fi.offset, sectorsize)) 535 - btrfs_err(fs_info, 536 - "partial page write in btrfs with offset %zu and length %zu", 537 - fi.offset, fi.length); 538 - else if (!IS_ALIGNED(fi.length, sectorsize)) 539 - btrfs_info(fs_info, 540 - "incomplete page write with offset %zu and length %zu", 541 - fi.offset, fi.length); 542 - 543 534 if (error) 544 535 mapping_set_error(folio->mapping, error); 545 536