From: Dave Chinner <david@fromorbit.com>
To: Bastien Traverse <bastien@esrevart.net>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [BUG] xfs_corruption_error after creating a swap file
Date: Wed, 13 Jan 2021 09:25:58 +1100 [thread overview]
Message-ID: <20210112222558.GV331610@dread.disaster.area> (raw)
In-Reply-To: <TMAUMQ.RILVCKL2FQ501@esrevart.net>
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@redhat.com>
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@fromorbit.com
next prev parent reply other threads:[~2021-01-12 22:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-12 21:06 [BUG] xfs_corruption_error after creating a swap file Bastien Traverse
2021-01-12 22:25 ` Dave Chinner [this message]
2021-01-12 22:50 ` Bastien Traverse
2021-01-12 23:43 ` Dave Chinner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210112222558.GV331610@dread.disaster.area \
--to=david@fromorbit.com \
--cc=bastien@esrevart.net \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox