* swap file broken with ext4 fast-commit
@ 2020-10-24 13:13 Andrea Righi
2020-10-24 13:38 ` Andrea Righi
0 siblings, 1 reply; 2+ messages in thread
From: Andrea Righi @ 2020-10-24 13:13 UTC (permalink / raw)
To: Harshad Shirwadkar
Cc: Theodore Ts'o, Andreas Dilger, linux-ext4, linux-kernel
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?
Thanks,
-Andrea
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: swap file broken with ext4 fast-commit
2020-10-24 13:13 swap file broken with ext4 fast-commit Andrea Righi
@ 2020-10-24 13:38 ` Andrea Righi
0 siblings, 0 replies; 2+ messages in thread
From: Andrea Righi @ 2020-10-24 13:38 UTC (permalink / raw)
To: Harshad Shirwadkar
Cc: Theodore Ts'o, Andreas Dilger, linux-ext4, linux-kernel
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-10-24 13:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-24 13:13 swap file broken with ext4 fast-commit Andrea Righi
2020-10-24 13:38 ` Andrea Righi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).