From: Andrea Righi <andrea.righi@canonical.com>
To: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
Cc: Theodore Ts'o <tytso@mit.edu>,
Andreas Dilger <adilger.kernel@dilger.ca>,
linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: swap file broken with ext4 fast-commit
Date: Sat, 24 Oct 2020 15:38:46 +0200 [thread overview]
Message-ID: <20201024133846.GA33750@xps-13-7390> (raw)
In-Reply-To: <20201024131333.GA32124@xps-13-7390>
On Sat, Oct 24, 2020 at 03:13:37PM +0200, Andrea Righi wrote:
> I'm getting the following error if I try to create and activate a swap
> file defined on an ext4 filesystem:
>
> [ 34.406479] swapon: file is not committed
>
> The swap file is created in the root filesystem (ext4 mounted with the
> following options):
>
> $ grep " / " /proc/mounts
> /dev/vda1 / ext4 rw,relatime 0 0
>
> No matter how long I wait or how many times I run sync, I'm still
> getting the same error and the swap file is never activated.
>
> A git bisect shows that this issue has been introduced by the following
> commit:
>
> aa75f4d3daae ("ext4: main fast-commit commit path")
>
> Simple test case to reproduce the problem:
>
> # fallocate -l 8G /swapfile
> # chmod 0600 /swapfile
> # mkswap /swapfile
> # swapon /swapfile
>
> Maybe we're missing to mark the inode as clean somewhere, even if the
> transation is committed to the journal?
I think I see the problem. There's something wrong in
ext4_inode_datasync_dirty(), it looks like the logic to check if the
inode is dirty is quite the opposite.
I'll test and send a patch soon.
-Andrea
prev parent reply other threads:[~2020-10-24 13:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-24 13:13 swap file broken with ext4 fast-commit Andrea Righi
2020-10-24 13:38 ` Andrea Righi [this message]
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=20201024133846.GA33750@xps-13-7390 \
--to=andrea.righi@canonical.com \
--cc=adilger.kernel@dilger.ca \
--cc=harshadshirwadkar@gmail.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@mit.edu \
/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