On 2020/5/15 12:14, Matthew Wilcox wrote: > On Thu, May 07, 2020 at 03:50:56PM +0800, Zhen Lei wrote: >> +++ b/mm/page_io.c >> @@ -38,7 +38,7 @@ static struct bio *get_swap_bio(gfp_t gfp_flags, >> >> bio->bi_iter.bi_sector = map_swap_page(page, &bdev); >> bio_set_dev(bio, bdev); >> - bio->bi_iter.bi_sector <<= PAGE_SHIFT - 9; >> + bio->bi_iter.bi_sector *= PAGE_SECTORS; >> bio->bi_end_io = end_io; > > This just doesn't look right. Why is map_swap_page() returning a sector_t > which isn't actually a sector_t? I try to understand map_swap_page(). Here maybe a bug. Otherwise, it would be better to add a temporary variable to cache the return value of map_swap_page(page, &bdev). > > > . > -- dm-devel mailing list [email protected] https://www.redhat.com/mailman/listinfo/dm-devel
- [dm-devel] [PATCH v2 00/10] clean up SECTOR related ... Zhen Lei
- [dm-devel] [PATCH v2 06/10] mm/swap: use npage_... Zhen Lei
- Re: [dm-devel] [PATCH v2 06/10] mm/swap: us... Matthew Wilcox
- Re: [dm-devel] [PATCH v2 06/10] mm/swap... Leizhen (ThunderTown)
- Re: [dm-devel] [PATCH v2 06/10] mm/swap: us... Matthew Wilcox
- Re: [dm-devel] [PATCH v2 06/10] mm/swap... Leizhen (ThunderTown)
- [dm-devel] [PATCH v2 08/10] md: use sectors_to_... Zhen Lei
- [dm-devel] [PATCH v2 02/10] zram: abolish macro... Zhen Lei
- [dm-devel] [PATCH v2 01/10] block: move PAGE_SE... Zhen Lei
- [dm-devel] [PATCH v2 09/10] md: use existing de... Zhen Lei
- [dm-devel] [PATCH v2 05/10] block: abolish macr... Zhen Lei
- [dm-devel] [PATCH v2 07/10] block: use sectors_... Zhen Lei
- Re: [dm-devel] [PATCH v2 07/10] block: use ... Matthew Wilcox
- Re: [dm-devel] [PATCH v2 07/10] block: ... Leizhen (ThunderTown)
