Re: [PATCH] ext4: Implement swap_activate aops using iomap

From: Theodore Y. Ts'o
Date: Thu Sep 24 2020 - 10:50:12 EST


On Fri, Sep 04, 2020 at 02:46:53PM +0530, Ritesh Harjani wrote:
> After moving ext4's bmap to iomap interface, swapon functionality
> on files created using fallocate (which creates unwritten extents) are
> failing. This is since iomap_bmap interface returns 0 for unwritten
> extents and thus generic_swapfile_activate considers this as holes
> and hence bail out with below kernel msg :-
>
> [340.915835] swapon: swapfile has holes
>
> To fix this we need to implement ->swap_activate aops in ext4
> which will use ext4_iomap_report_ops. Since we only need to return
> the list of extents so ext4_iomap_report_ops should be enough.
>
> Reported-by: Yuxuan Shui <yshuiv7@xxxxxxxxx>
> Fixes: ac58e4fb03f ("ext4: move ext4 bmap to use iomap infrastructure")
> Signed-off-by: Ritesh Harjani <riteshh@xxxxxxxxxxxxx>

Thanks, applied.

- Ted