Re: [BUG] xfs_corruption_error after creating a swap file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 12, 2021 at 10:06:29PM +0100, Bastien Traverse wrote:
> Hello everyone,
> 
> A couple of weeks back I got an xfs_corruption_error stack trace on my
> rootfs on Arch Linux, a few minutes after creating a swap file an enabling
> it. Here is the process I followed to do so:
> 
>    fallocate -l 4G /swapfile
>    chmod 600 /swapfile
>    mkswap /swapfile
>    swapon /swapfile
>    echo "/swapfile none swap defaults 0 0" >> /etc/fstab
> 
> And the trace appeared a few minutes later, without me doing much at that
> moment:

Sounds like:

commit 41663430588c737dd735bad5a0d1ba325dcabd59
Author: Gao Xiang <hsiangkao@xxxxxxxxxx>
Date:   Fri Sep 25 21:19:01 2020 -0700

    mm, THP, swap: fix allocating cluster for swapfile by mistake
    
    SWP_FS is used to make swap_{read,write}page() go through the
    filesystem, and it's only used for swap files over NFS.  So, !SWP_FS
    means non NFS for now, it could be either file backed or device backed.
    Something similar goes with legacy SWP_FILE.
    
    So in order to achieve the goal of the original patch, SWP_BLKDEV should
    be used instead.
    
    FS corruption can be observed with SSD device + XFS + fragmented
    swapfile due to CONFIG_THP_SWAP=y.
.....

But I thought that was fixed in 5.9-rc7 so should be in your kernel.
Can you confirm that your kernel has this fix?

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux