* [LTP] [PATCH v1 1/1] swap: Add exfat to filesystems requiring tst_fill_file
@ 2026-06-08 15:52 Jan Polensky
2026-06-08 16:29 ` [LTP] " linuxtestproject.agent
2026-06-09 9:19 ` [LTP] [PATCH v1 1/1] " Cyril Hrubis
0 siblings, 2 replies; 22+ messages in thread
From: Jan Polensky @ 2026-06-08 15:52 UTC (permalink / raw)
To: ltp
exfat, like XFS, requires actual data writes (not just fallocate) to
fully allocate swap files. Without this, swapon(2) fails with EINVAL
due to unallocated extents.
This matches the kernel's requirement that swap files must be fully
allocated before activation.
Signed-off-by: Jan Polensky <japo@linux.ibm.com>
---
libs/swap/tse_swap.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/libs/swap/tse_swap.c b/libs/swap/tse_swap.c
index ae3c193132e6..e321cb1dfe63 100644
--- a/libs/swap/tse_swap.c
+++ b/libs/swap/tse_swap.c
@@ -177,8 +177,9 @@ int make_swapfile(const char *file, const int lineno,
if (prealloc_contiguous_file(swapfile, blk_size, blocks) != 0)
tst_brk_(file, lineno, TBROK, "Failed to create swapfile");
- /* Fill the file if needed (specific to old xfs filesystems) */
- if (tst_fs_type(swapfile) == TST_XFS_MAGIC) {
+ /* Fill the file if needed (specific to xfs and exfat filesystems) */
+ long fs_type = tst_fs_type(swapfile);
+ if (fs_type == TST_XFS_MAGIC || fs_type == TST_EXFAT_MAGIC) {
if (tst_fill_file(swapfile, 0, blk_size, blocks) != 0)
tst_brk_(file, lineno, TBROK, "Failed to fill swapfile");
}
--
2.54.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [LTP] swap: Add exfat to filesystems requiring tst_fill_file
2026-06-08 15:52 [LTP] [PATCH v1 1/1] swap: Add exfat to filesystems requiring tst_fill_file Jan Polensky
@ 2026-06-08 16:29 ` linuxtestproject.agent
2026-06-09 9:19 ` [LTP] [PATCH v1 1/1] " Cyril Hrubis
1 sibling, 0 replies; 22+ messages in thread
From: linuxtestproject.agent @ 2026-06-08 16:29 UTC (permalink / raw)
To: Jan Polensky; +Cc: ltp
Hi Jan,
On 08 Jun 2026, Jan Polensky wrote:
> swap: Add exfat to filesystems requiring tst_fill_file
Verdict: Reviewed
---
Note:
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [LTP] [PATCH v1 1/1] swap: Add exfat to filesystems requiring tst_fill_file
2026-06-08 15:52 [LTP] [PATCH v1 1/1] swap: Add exfat to filesystems requiring tst_fill_file Jan Polensky
2026-06-08 16:29 ` [LTP] " linuxtestproject.agent
@ 2026-06-09 9:19 ` Cyril Hrubis
2026-06-09 14:17 ` Jan Polensky
1 sibling, 1 reply; 22+ messages in thread
From: Cyril Hrubis @ 2026-06-09 9:19 UTC (permalink / raw)
To: Jan Polensky; +Cc: ltp
Hi!
> exfat, like XFS, requires actual data writes (not just fallocate) to
> fully allocate swap files. Without this, swapon(2) fails with EINVAL
> due to unallocated extents.
>
> This matches the kernel's requirement that swap files must be fully
> allocated before activation.
>
> Signed-off-by: Jan Polensky <japo@linux.ibm.com>
> ---
> libs/swap/tse_swap.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/libs/swap/tse_swap.c b/libs/swap/tse_swap.c
> index ae3c193132e6..e321cb1dfe63 100644
> --- a/libs/swap/tse_swap.c
> +++ b/libs/swap/tse_swap.c
> @@ -177,8 +177,9 @@ int make_swapfile(const char *file, const int lineno,
> if (prealloc_contiguous_file(swapfile, blk_size, blocks) != 0)
> tst_brk_(file, lineno, TBROK, "Failed to create swapfile");
>
> - /* Fill the file if needed (specific to old xfs filesystems) */
> - if (tst_fs_type(swapfile) == TST_XFS_MAGIC) {
> + /* Fill the file if needed (specific to xfs and exfat filesystems) */
> + long fs_type = tst_fs_type(swapfile);
> + if (fs_type == TST_XFS_MAGIC || fs_type == TST_EXFAT_MAGIC) {
> if (tst_fill_file(swapfile, 0, blk_size, blocks) != 0)
> tst_brk_(file, lineno, TBROK, "Failed to fill swapfile");
> }
The swapon01 works for me for exfat without this change. Where does this
fail (arch, kernel, OS, is exfat in kernel or FUSE, etc.)?
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [LTP] [PATCH v1 1/1] swap: Add exfat to filesystems requiring tst_fill_file
2026-06-09 9:19 ` [LTP] [PATCH v1 1/1] " Cyril Hrubis
@ 2026-06-09 14:17 ` Jan Polensky
2026-06-12 9:06 ` Andrea Cervesato via ltp
0 siblings, 1 reply; 22+ messages in thread
From: Jan Polensky @ 2026-06-09 14:17 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: ltp
On Tue, Jun 09, 2026 at 11:19:19AM +0200, Cyril Hrubis wrote:
> Hi!
> > exfat, like XFS, requires actual data writes (not just fallocate) to
> > fully allocate swap files. Without this, swapon(2) fails with EINVAL
> > due to unallocated extents.
> >
> > This matches the kernel's requirement that swap files must be fully
> > allocated before activation.
> >
> > Signed-off-by: Jan Polensky <japo@linux.ibm.com>
> > ---
> > libs/swap/tse_swap.c | 5 +++--
> > 1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/libs/swap/tse_swap.c b/libs/swap/tse_swap.c
> > index ae3c193132e6..e321cb1dfe63 100644
> > --- a/libs/swap/tse_swap.c
> > +++ b/libs/swap/tse_swap.c
> > @@ -177,8 +177,9 @@ int make_swapfile(const char *file, const int lineno,
> > if (prealloc_contiguous_file(swapfile, blk_size, blocks) != 0)
> > tst_brk_(file, lineno, TBROK, "Failed to create swapfile");
> >
> > - /* Fill the file if needed (specific to old xfs filesystems) */
> > - if (tst_fs_type(swapfile) == TST_XFS_MAGIC) {
> > + /* Fill the file if needed (specific to xfs and exfat filesystems) */
> > + long fs_type = tst_fs_type(swapfile);
> > + if (fs_type == TST_XFS_MAGIC || fs_type == TST_EXFAT_MAGIC) {
> > if (tst_fill_file(swapfile, 0, blk_size, blocks) != 0)
> > tst_brk_(file, lineno, TBROK, "Failed to fill swapfile");
> > }
>
Hi Cyril,
> The swapon01 works for me for exfat without this change. Where does this
> fail (arch, kernel, OS, is exfat in kernel or FUSE, etc.)?
The failure occurred on:
- Architecture: s390x
- Kernel: 7.1.0-20260608.rc7.git374.a87737435cfa.300.fc44.s390x+next
(linux-next and since ~ 17 days)
- OS: Fedora Linux 44
- exfat: Kernel module (not FUSE)
The issue manifests when swapon(2) is called on an exfat swap file that was
created using only fallocate() without actual data writes. The kernel rejects
the swap file with EINVAL because it detects unallocated extents.
This is similar to the existing XFS behavior where tst_fill_file() is already
required. Both filesystems need actual data writes (not just metadata
allocation via fallocate) to ensure swap files are fully allocated before
swapon(2) can activate them.
The patch ensures consistent behavior across filesystems that have this
requirement.
Best regards,
Jan
>
> --
> Cyril Hrubis
> chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [LTP] [PATCH v1 1/1] swap: Add exfat to filesystems requiring tst_fill_file
2026-06-09 14:17 ` Jan Polensky
@ 2026-06-12 9:06 ` Andrea Cervesato via ltp
2026-06-12 9:07 ` Cyril Hrubis
0 siblings, 1 reply; 22+ messages in thread
From: Andrea Cervesato via ltp @ 2026-06-12 9:06 UTC (permalink / raw)
To: Jan Polensky; +Cc: ltp
Hi Jan,
maybe I reproduced it, but it would be nice to have the test output
as well. Also Kernel 7.1 is still in RC stage, so this patch must
wait kernel release before being considered valid.
The next time please add more information to the commit, so we know
exactly what kernel version is having issues, as well as the arch
and distro.
Regards,
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [LTP] [PATCH v1 1/1] swap: Add exfat to filesystems requiring tst_fill_file
2026-06-12 9:06 ` Andrea Cervesato via ltp
@ 2026-06-12 9:07 ` Cyril Hrubis
2026-06-17 13:56 ` Andrea Cervesato via ltp
0 siblings, 1 reply; 22+ messages in thread
From: Cyril Hrubis @ 2026-06-12 9:07 UTC (permalink / raw)
To: Andrea Cervesato; +Cc: ltp
Hi!
> maybe I reproduced it, but it would be nice to have the test output
> as well. Also Kernel 7.1 is still in RC stage, so this patch must
> wait kernel release before being considered valid.
If it's reproducible only in 7.1 isn't it a kernel regression?
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [LTP] [PATCH v1 1/1] swap: Add exfat to filesystems requiring tst_fill_file
2026-06-12 9:07 ` Cyril Hrubis
@ 2026-06-17 13:56 ` Andrea Cervesato via ltp
2026-06-17 14:59 ` Andrea Cervesato via ltp
0 siblings, 1 reply; 22+ messages in thread
From: Andrea Cervesato via ltp @ 2026-06-17 13:56 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: ltp
Hi Cyril,
> > maybe I reproduced it, but it would be nice to have the test output
> > as well. Also Kernel 7.1 is still in RC stage, so this patch must
> > wait kernel release before being considered valid.
>
> If it's reproducible only in 7.1 isn't it a kernel regression?
Had time to go back looking at the results. Error was caused by an
another issue on my side. I also can't reprouce the issue on kernel
7.1.0 after the release. I ran swapon01, but it runs fine.
Regards,
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [LTP] [PATCH v1 1/1] swap: Add exfat to filesystems requiring tst_fill_file
2026-06-17 13:56 ` Andrea Cervesato via ltp
@ 2026-06-17 14:59 ` Andrea Cervesato via ltp
2026-06-17 15:19 ` Andrea Cervesato via ltp
0 siblings, 1 reply; 22+ messages in thread
From: Andrea Cervesato via ltp @ 2026-06-17 14:59 UTC (permalink / raw)
To: Andrea Cervesato; +Cc: ltp
An update. I had to go through the code to understand if we are having
issues from our side. Indeed, there's a commit which is responsible for
this exfat behaviour and it's causing a regression-like issue:
bf1797960c20 - exfat: add fallocate FALLOC_FL_ALLOCATE_RANGE support
tst_prealloc_size_fd() is called by make_swapfile() which is called by our
swapon/swapoff testing suites. Inside it we use fallocate() that is now
supported by exfat and returns 0 after the kernel patch.
This naturally falls down into the next:
/* Fill the file if needed (specific to old xfs filesystems) */
if (tst_fs_type(swapfile) == TST_XFS_MAGIC) {
if (tst_fill_file(swapfile, 0, blk_size, blocks) != 0)
tst_brk_(file, lineno, TBROK, "Failed to fill swapfile");
}
but there's no data written and we get EINVAL at the end of the tests
because swapon() is using a file created with fallocate() instead.
The Jan assumption is correct and the patch as well, but it's strange
we can't reproduce it. The EINVAL is the expected behaviour in this case.
I'm just wondering how to implement it better.
First of all, we should mention the commit that introduced fallocate()
support into exfat inside the patch commit message.
Secondly, since the code was already working before v7.1, maybe we should
fill the file in exfat only for kernel >= 7.1. But I don't want to touch
the core library.
@Cyril WDYT?
Regards,
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [LTP] [PATCH v1 1/1] swap: Add exfat to filesystems requiring tst_fill_file
2026-06-17 14:59 ` Andrea Cervesato via ltp
@ 2026-06-17 15:19 ` Andrea Cervesato via ltp
2026-06-18 11:53 ` Jan Polensky
0 siblings, 1 reply; 22+ messages in thread
From: Andrea Cervesato via ltp @ 2026-06-17 15:19 UTC (permalink / raw)
To: Andrea Cervesato; +Cc: ltp
> I'm just wondering how to implement it better.
>
> First of all, we should mention the commit that introduced fallocate()
> support into exfat inside the patch commit message.
>
> Secondly, since the code was already working before v7.1, maybe we should
> fill the file in exfat only for kernel >= 7.1. But I don't want to touch
> the core library.
Second update: .swap_activate is not implemented in the linux kernel
for exfat and the commit causes EINVAL only for swap allocation. That
is caused by bmap() due to the generic swap activation.
So instead of working around the issue, we probably should have a feature
in the kernel along with fallocate() support in exfat.
Probably a kernel bug/missing feature.
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [LTP] [PATCH v1 1/1] swap: Add exfat to filesystems requiring tst_fill_file
2026-06-17 15:19 ` Andrea Cervesato via ltp
@ 2026-06-18 11:53 ` Jan Polensky
2026-06-18 12:04 ` Andrea Cervesato via ltp
0 siblings, 1 reply; 22+ messages in thread
From: Jan Polensky @ 2026-06-18 11:53 UTC (permalink / raw)
To: Andrea Cervesato; +Cc: ltp
On Wed, Jun 17, 2026 at 03:19:07PM +0000, Andrea Cervesato wrote:
> > I'm just wondering how to implement it better.
> >
> > First of all, we should mention the commit that introduced fallocate()
> > support into exfat inside the patch commit message.
> >
> > Secondly, since the code was already working before v7.1, maybe we should
> > fill the file in exfat only for kernel >= 7.1. But I don't want to touch
> > the core library.
>
> Second update: .swap_activate is not implemented in the linux kernel
> for exfat and the commit causes EINVAL only for swap allocation. That
> is caused by bmap() due to the generic swap activation.
>
> So instead of working around the issue, we probably should have a feature
> in the kernel along with fallocate() support in exfat.
>
> Probably a kernel bug/missing feature.
>
> --
> Andrea Cervesato
> SUSE QE Automation Engineer Linux
> andrea.cervesato@suse.com
Hi Andrea,
just to add some context: the regression itself was on the kernel side.
The relevant upstream patch is
https://lore.kernel.org/all/20260603131950.321858-1-japo@linux.ibm.com/.
My understanding is that the kernel-side change did not resolve the issue
for the LTP test suite, and that there was also a separate LTP-relevant
aspect for exfat swapfiles, where actual data writes are required before
swapon() succeeds.
Best regards,
Jan
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [LTP] [PATCH v1 1/1] swap: Add exfat to filesystems requiring tst_fill_file
2026-06-18 11:53 ` Jan Polensky
@ 2026-06-18 12:04 ` Andrea Cervesato via ltp
2026-06-18 14:47 ` Jan Polensky
0 siblings, 1 reply; 22+ messages in thread
From: Andrea Cervesato via ltp @ 2026-06-18 12:04 UTC (permalink / raw)
To: Jan Polensky; +Cc: ltp
Hi Jan,
> Hi Andrea,
>
> just to add some context: the regression itself was on the kernel side.
> The relevant upstream patch is
> https://lore.kernel.org/all/20260603131950.321858-1-japo@linux.ibm.com/.
> My understanding is that the kernel-side change did not resolve the issue
> for the LTP test suite, and that there was also a separate LTP-relevant
> aspect for exfat swapfiles, where actual data writes are required before
> swapon() succeeds.
Sorry, I forgot to properly reply to this email.
Today I sent a patch to fix the kernel, you can take a look at it here:
https://lore.kernel.org/all/20260618-exfat_swap_activate-v1-1-4c6a465df295@suse.com/
This patch should fix the issue, let me know if you are still seeing a
failure in the LTP tests after applying it.
Thanks,
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [LTP] [PATCH v1 1/1] swap: Add exfat to filesystems requiring tst_fill_file
2026-06-18 12:04 ` Andrea Cervesato via ltp
@ 2026-06-18 14:47 ` Jan Polensky
2026-06-18 14:57 ` Andrea Cervesato via ltp
2026-07-02 10:10 ` Andrea Cervesato via ltp
0 siblings, 2 replies; 22+ messages in thread
From: Jan Polensky @ 2026-06-18 14:47 UTC (permalink / raw)
To: Andrea Cervesato; +Cc: ltp
On Thu, Jun 18, 2026 at 12:04:27PM +0000, Andrea Cervesato wrote:
> Hi Jan,
>
> > Hi Andrea,
> >
> > just to add some context: the regression itself was on the kernel side.
> > The relevant upstream patch is
> > https://lore.kernel.org/all/20260603131950.321858-1-japo@linux.ibm.com/.
> > My understanding is that the kernel-side change did not resolve the issue
> > for the LTP test suite, and that there was also a separate LTP-relevant
> > aspect for exfat swapfiles, where actual data writes are required before
> > swapon() succeeds.
>
> Sorry, I forgot to properly reply to this email.
>
> Today I sent a patch to fix the kernel, you can take a look at it here:
> https://lore.kernel.org/all/20260618-exfat_swap_activate-v1-1-4c6a465df295@suse.com/
>
> This patch should fix the issue, let me know if you are still seeing a
> failure in the LTP tests after applying it.
>
> Thanks,
> --
> Andrea Cervesato
> SUSE QE Automation Engineer Linux
> andrea.cervesato@suse.com
Hi Andrea,
thanks, this fixes the swapping issue for me on s390.
There is just one remaining problem: when exfat is built as a module
(CONFIG_EXFAT_FS=m), the build fails because
generic_swapfile_activate() is not exported.
Please add EXPORT_SYMBOL_GPL(generic_swapfile_activate) in mm/page_io.c.
Best regards,
Jan
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [LTP] [PATCH v1 1/1] swap: Add exfat to filesystems requiring tst_fill_file
2026-06-18 14:47 ` Jan Polensky
@ 2026-06-18 14:57 ` Andrea Cervesato via ltp
2026-07-02 10:10 ` Andrea Cervesato via ltp
1 sibling, 0 replies; 22+ messages in thread
From: Andrea Cervesato via ltp @ 2026-06-18 14:57 UTC (permalink / raw)
To: Jan Polensky; +Cc: ltp
> thanks, this fixes the swapping issue for me on s390.
Great :-)
>
> There is just one remaining problem: when exfat is built as a module
> (CONFIG_EXFAT_FS=m), the build fails because
> generic_swapfile_activate() is not exported.
>
> Please add EXPORT_SYMBOL_GPL(generic_swapfile_activate) in mm/page_io.c.
Ah that's right, I will wait for kernel devs reply and then point
it out in the conversation. Thanks for the suggestion.
Regards,
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [LTP] [PATCH v1 1/1] swap: Add exfat to filesystems requiring tst_fill_file
2026-06-18 14:47 ` Jan Polensky
2026-06-18 14:57 ` Andrea Cervesato via ltp
@ 2026-07-02 10:10 ` Andrea Cervesato via ltp
2026-07-07 9:59 ` Jan Polensky
1 sibling, 1 reply; 22+ messages in thread
From: Andrea Cervesato via ltp @ 2026-07-02 10:10 UTC (permalink / raw)
To: Jan Polensky; +Cc: ltp
Hi Jan,
I seen you implemented in v7.2-rc1:
commit 03a43677ca91e3997355a13b1da6e47329b025e1
Author: Jan Polensky <japo@linux.ibm.com>
Date: Tue Jun 9 18:21:49 2026 +0900
exfat: add swap_activate support
Commit 07d67f3e9083 ("exfat: add iomap buffered I/O support")
converted exfat buffered I/O to iomap, but did not add a
.swap_activate handler to the address_space_operations.
swapon(2) on an exfat swapfile then fails with EINVAL, which causes
LTP swap tests to fail.
Add exfat_iomap_swap_activate() and hook it into exfat_aops so exfat
uses iomap_swapfile_activate() for swapfile activation.
Fixes: 614f71ca1bdf ("exfat: add iomap buffered I/O support")
Closes: https://lore.kernel.org/all/20260603110212.3020276-1-japo@linux.ibm.com/
Signed-off-by: Jan Polensky <japo@linux.ibm.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
what should we do with your patch in LTP?
Regards,
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [LTP] [PATCH v1 1/1] swap: Add exfat to filesystems requiring tst_fill_file
2026-07-02 10:10 ` Andrea Cervesato via ltp
@ 2026-07-07 9:59 ` Jan Polensky
2026-08-25 11:27 ` Petr Vorel
0 siblings, 1 reply; 22+ messages in thread
From: Jan Polensky @ 2026-07-07 9:59 UTC (permalink / raw)
To: Andrea Cervesato; +Cc: ltp
On Thu, Jul 02, 2026 at 10:10:09AM +0000, Andrea Cervesato wrote:
> Hi Jan,
>
> I seen you implemented in v7.2-rc1:
>
> commit 03a43677ca91e3997355a13b1da6e47329b025e1
> Author: Jan Polensky <japo@linux.ibm.com>
> Date: Tue Jun 9 18:21:49 2026 +0900
>
> exfat: add swap_activate support
>
> Commit 07d67f3e9083 ("exfat: add iomap buffered I/O support")
> converted exfat buffered I/O to iomap, but did not add a
> .swap_activate handler to the address_space_operations.
>
> swapon(2) on an exfat swapfile then fails with EINVAL, which causes
> LTP swap tests to fail.
>
> Add exfat_iomap_swap_activate() and hook it into exfat_aops so exfat
> uses iomap_swapfile_activate() for swapfile activation.
>
> Fixes: 614f71ca1bdf ("exfat: add iomap buffered I/O support")
> Closes: https://lore.kernel.org/all/20260603110212.3020276-1-japo@linux.ibm.com/
> Signed-off-by: Jan Polensky <japo@linux.ibm.com>
> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
>
> what should we do with your patch in LTP?
>
> Regards,
> --
> Andrea Cervesato
> SUSE QE Automation Engineer Linux
> andrea.cervesato@suse.com
Hi Andrea,
Thanks for following up on this.
On my side (s390x, Fedora 44, kernel v7.2-rc1), I still need both
patches for the LTP swap tests to pass:
1. The kernel fix (03a43677ca91 "exfat: add swap_activate support")
2. This LTP patch (adding exfat to tst_fill_file)
Without the LTP patch, the tests still fail even with the kernel fix
applied.
Could you validate on your setup whether the kernel fix alone is
sufficient, or if you also need this LTP patch? It would be good to
understand if this is architecture-specific or a general requirement.
If you can confirm the tests pass with only the kernel fix, we can
close this LTP patch. Otherwise, one should merge it.
Best regards,
Jan
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [LTP] [PATCH v1 1/1] swap: Add exfat to filesystems requiring tst_fill_file
2026-07-07 9:59 ` Jan Polensky
@ 2026-08-25 11:27 ` Petr Vorel
2026-08-25 12:17 ` Andrea Cervesato via ltp
2026-08-25 13:08 ` Cyril Hrubis
0 siblings, 2 replies; 22+ messages in thread
From: Petr Vorel @ 2026-08-25 11:27 UTC (permalink / raw)
To: Jan Polensky; +Cc: ltp
> On Thu, Jul 02, 2026 at 10:10:09AM +0000, Andrea Cervesato wrote:
> > Hi Jan,
> > I seen you implemented in v7.2-rc1:
> > commit 03a43677ca91e3997355a13b1da6e47329b025e1
> > Author: Jan Polensky <japo@linux.ibm.com>
> > Date: Tue Jun 9 18:21:49 2026 +0900
> > exfat: add swap_activate support
> > Commit 07d67f3e9083 ("exfat: add iomap buffered I/O support")
> > converted exfat buffered I/O to iomap, but did not add a
> > .swap_activate handler to the address_space_operations.
> > swapon(2) on an exfat swapfile then fails with EINVAL, which causes
> > LTP swap tests to fail.
> > Add exfat_iomap_swap_activate() and hook it into exfat_aops so exfat
> > uses iomap_swapfile_activate() for swapfile activation.
> > Fixes: 614f71ca1bdf ("exfat: add iomap buffered I/O support")
> > Closes: https://lore.kernel.org/all/20260603110212.3020276-1-japo@linux.ibm.com/
> > Signed-off-by: Jan Polensky <japo@linux.ibm.com>
> > Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
> > what should we do with your patch in LTP?
> > Regards,
> > --
> > Andrea Cervesato
> > SUSE QE Automation Engineer Linux
> > andrea.cervesato@suse.com
> Hi Andrea,
> Thanks for following up on this.
> On my side (s390x, Fedora 44, kernel v7.2-rc1), I still need both
> patches for the LTP swap tests to pass:
> 1. The kernel fix (03a43677ca91 "exfat: add swap_activate support")
> 2. This LTP patch (adding exfat to tst_fill_file)
> Without the LTP patch, the tests still fail even with the kernel fix
> applied.
> Could you validate on your setup whether the kernel fix alone is
> sufficient, or if you also need this LTP patch? It would be good to
> understand if this is architecture-specific or a general requirement.
> If you can confirm the tests pass with only the kernel fix, we can
> close this LTP patch. Otherwise, one should merge it.
Reviewed-by: Petr Vorel <pvorel@suse.cz>
And yeah, we need it in kernel 7.2 on any distro :).
Should we somehow mention relevant kernel commit at least in the commit message?
e.g.: Change needed since 03a43677ca91 ("exfat: add swap_activate support") from
v7.2-rc1.
Kind regards,
Petr
> Best regards,
> Jan
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [LTP] [PATCH v1 1/1] swap: Add exfat to filesystems requiring tst_fill_file
2026-08-25 11:27 ` Petr Vorel
@ 2026-08-25 12:17 ` Andrea Cervesato via ltp
2026-08-25 13:08 ` Cyril Hrubis
1 sibling, 0 replies; 22+ messages in thread
From: Andrea Cervesato via ltp @ 2026-08-25 12:17 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp
Hi Petr,
> Reviewed-by: Petr Vorel <pvorel@suse.cz>
>
> And yeah, we need it in kernel 7.2 on any distro :).
>
> Should we somehow mention relevant kernel commit at least in the commit message?
>
> e.g.: Change needed since 03a43677ca91 ("exfat: add swap_activate support") from
> v7.2-rc1.
yes it makes sense to do it before merge.
Thanks,
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [LTP] [PATCH v1 1/1] swap: Add exfat to filesystems requiring tst_fill_file
2026-08-25 11:27 ` Petr Vorel
2026-08-25 12:17 ` Andrea Cervesato via ltp
@ 2026-08-25 13:08 ` Cyril Hrubis
2026-08-25 13:26 ` Petr Vorel
1 sibling, 1 reply; 22+ messages in thread
From: Cyril Hrubis @ 2026-08-25 13:08 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp
Hi!
> Reviewed-by: Petr Vorel <pvorel@suse.cz>
>
> And yeah, we need it in kernel 7.2 on any distro :).
>
> Should we somehow mention relevant kernel commit at least in the commit message?
>
> e.g.: Change needed since 03a43677ca91 ("exfat: add swap_activate support") from
> v7.2-rc1.
That does not make much sense, if swap_activate was added to kernel,
pre-filling the fallocated file shouldn't be needed anymore.
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [LTP] [PATCH v1 1/1] swap: Add exfat to filesystems requiring tst_fill_file
2026-08-25 13:08 ` Cyril Hrubis
@ 2026-08-25 13:26 ` Petr Vorel
2026-08-25 13:46 ` Cyril Hrubis
0 siblings, 1 reply; 22+ messages in thread
From: Petr Vorel @ 2026-08-25 13:26 UTC (permalink / raw)
To: Cyril Hrubis
Cc: regressions, Yuezhang Mo, linux-kernel, Christoph Hellwig,
Darrick J . Wong, Sungjong Seo, Namjae Jeon, ltp
Hi all,
[ Cc kernel folks and LKML ]
> Hi!
> > Reviewed-by: Petr Vorel <pvorel@suse.cz>
> > And yeah, we need it in kernel 7.2 on any distro :).
... and on any arch, e.g. x86_64 (not just s390x as Jan previously reported [1])
> > Should we somehow mention relevant kernel commit at least in the commit message?
> > e.g.: Change needed since 03a43677ca91 ("exfat: add swap_activate support") from
> > v7.2-rc1.
> That does not make much sense, if swap_activate was added to kernel,
> pre-filling the fallocated file shouldn't be needed anymore.
Good catch, you're right. I'm also confused, before v7.2 swap worked on exfat,
now even with 82a81a7352bc ("exfat: add iomap buffered I/O support") [2]
and your fix 03a43677ca91 ("exfat: add swap_activate support") [3] is not
working. Obviously the fix was not good enough.
Kind regards,
Petr
[1] https://lore.kernel.org/ltp/akzN_iISxNTztbEw@li-276bd24c-2dcc-11b2-a85c-945b6f05615c.ibm.com/
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=82a81a7352bcf5f2756ac33d47ee0582737e9a85
[3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=03a43677ca91e3997355a13b1da6e47329b025e1
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [LTP] [PATCH v1 1/1] swap: Add exfat to filesystems requiring tst_fill_file
2026-08-25 13:26 ` Petr Vorel
@ 2026-08-25 13:46 ` Cyril Hrubis
2026-08-26 0:23 ` Namjae Jeon via ltp
0 siblings, 1 reply; 22+ messages in thread
From: Cyril Hrubis @ 2026-08-25 13:46 UTC (permalink / raw)
To: Petr Vorel
Cc: regressions, Yuezhang Mo, linux-kernel, Christoph Hellwig,
Darrick J . Wong, Sungjong Seo, Namjae Jeon, ltp
Hi!
> > That does not make much sense, if swap_activate was added to kernel,
> > pre-filling the fallocated file shouldn't be needed anymore.
>
> Good catch, you're right. I'm also confused, before v7.2 swap worked on exfat,
> now even with 82a81a7352bc ("exfat: add iomap buffered I/O support") [2]
> and your fix 03a43677ca91 ("exfat: add swap_activate support") [3] is not
> working. Obviously the fix was not good enough.
There were two bugs I suppose, one is that fallocate() support for exfat broke
the swapon on fallocated file. The second bug was introduced later when
exfat was rewritten to use iomap. The iomap case was fixed in the patch
above, however it looks like the original bug caused by fallocate()
implementation for exfat is still there.
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [LTP] [PATCH v1 1/1] swap: Add exfat to filesystems requiring tst_fill_file
2026-08-25 13:46 ` Cyril Hrubis
@ 2026-08-26 0:23 ` Namjae Jeon via ltp
2026-08-26 7:41 ` Petr Vorel
0 siblings, 1 reply; 22+ messages in thread
From: Namjae Jeon via ltp @ 2026-08-26 0:23 UTC (permalink / raw)
To: Cyril Hrubis
Cc: regressions, Yuezhang Mo, linux-kernel, Darrick J . Wong,
Sungjong Seo, Christoph Hellwig, ltp
On Tue, Aug 25, 2026 at 10:46 PM Cyril Hrubis <chrubis@suse.cz> wrote:
>
> Hi!
Hi Cyril, Petr,
> > > That does not make much sense, if swap_activate was added to kernel,
> > > pre-filling the fallocated file shouldn't be needed anymore.
> >
> > Good catch, you're right. I'm also confused, before v7.2 swap worked on exfat,
> > now even with 82a81a7352bc ("exfat: add iomap buffered I/O support") [2]
> > and your fix 03a43677ca91 ("exfat: add swap_activate support") [3] is not
> > working. Obviously the fix was not good enough.
>
> There were two bugs I suppose, one is that fallocate() support for exfat broke
> the swapon on fallocated file. The second bug was introduced later when
> exfat was rewritten to use iomap. The iomap case was fixed in the patch
> above, however it looks like the original bug caused by fallocate()
> implementation for exfat is still there.
Can you check if an attached patch improves this issue?
Thanks.
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [LTP] [PATCH v1 1/1] swap: Add exfat to filesystems requiring tst_fill_file
2026-08-26 0:23 ` Namjae Jeon via ltp
@ 2026-08-26 7:41 ` Petr Vorel
0 siblings, 0 replies; 22+ messages in thread
From: Petr Vorel @ 2026-08-26 7:41 UTC (permalink / raw)
To: Namjae Jeon
Cc: regressions, Yuezhang Mo, linux-kernel, Darrick J . Wong,
Sungjong Seo, Christoph Hellwig, ltp
Hi Namjae,
> On Tue, Aug 25, 2026 at 10:46 PM Cyril Hrubis <chrubis@suse.cz> wrote:
> > Hi!
> Hi Cyril, Petr,
> > > > That does not make much sense, if swap_activate was added to kernel,
> > > > pre-filling the fallocated file shouldn't be needed anymore.
> > > Good catch, you're right. I'm also confused, before v7.2 swap worked on exfat,
> > > now even with 82a81a7352bc ("exfat: add iomap buffered I/O support") [2]
> > > and your fix 03a43677ca91 ("exfat: add swap_activate support") [3] is not
> > > working. Obviously the fix was not good enough.
> > There were two bugs I suppose, one is that fallocate() support for exfat broke
> > the swapon on fallocated file. The second bug was introduced later when
> > exfat was rewritten to use iomap. The iomap case was fixed in the patch
> > above, however it looks like the original bug caused by fallocate()
> > implementation for exfat is still there.
> Can you check if an attached patch improves this issue?
> Thanks.
LGTM.
Tested-by: Petr Vorel <pvorel@suse.cz>
Tested on rapido-linux with:
CONFIG_EXFAT_FS=y
CONFIG_EXFAT_DEFAULT_IOCHARSET="utf8"
Hopefully Jan will test it as well, built as module.
Kind regards,
Petr
> From 5679a624816454c8e7683842eb0ab3f1adf0dcca Mon Sep 17 00:00:00 2001
> From: Namjae Jeon <linkinjeon@kernel.org>
> Date: Wed, 26 Aug 2026 09:14:14 +0900
> Subject: [PATCH] exfat: map allocated extents for swap activation
> exFAT reports allocated ranges beyond valid_size as IOMAP_HOLE when
> IOMAP_REPORT is set. iomap_swapfile_activate() also uses IOMAP_REPORT
> while collecting physical extents for a swap file, so it treats the
> preallocated tail as unallocated and rejects the file with -EINVAL.
> Use swap-specific iomap operations that suppress IOMAP_REPORT before
> mapping the file. This reports physically allocated ranges as
> IOMAP_UNWRITTEN during swap activation without changing the
> byte-accurate SEEK_HOLE and SEEK_DATA behavior of the regular iomap
> operations.
> Fixes: 03a43677ca91 ("exfat: add swap_activate support")
> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
> ---
> fs/exfat/iomap.c | 19 ++++++++++++++++++-
> 1 file changed, 18 insertions(+), 1 deletion(-)
> diff --git a/fs/exfat/iomap.c b/fs/exfat/iomap.c
> index 0c805bf6676a..bf8baf78a9b8 100644
> --- a/fs/exfat/iomap.c
> +++ b/fs/exfat/iomap.c
> @@ -155,6 +155,22 @@ const struct iomap_ops exfat_iomap_ops = {
> .iomap_begin = exfat_iomap_begin,
> };
> +static int exfat_swap_iomap_begin(struct inode *inode, loff_t offset,
> + loff_t length, unsigned int flags, struct iomap *iomap,
> + struct iomap *srcmap)
> +{
> + /*
> + * Swap activation needs the physical mappings of preallocated
> + * ranges. Do not report the VDL tail as a hole.
> + */
> + return __exfat_iomap_begin(inode, offset, length,
> + flags & ~IOMAP_REPORT, iomap, false);
> +}
> +
> +static const struct iomap_ops exfat_swap_iomap_ops = {
> + .iomap_begin = exfat_swap_iomap_begin,
> +};
> +
> /*
> * exfat_write_iomap_end - Update the state after write
> *
> @@ -274,5 +290,6 @@ const struct iomap_read_ops exfat_iomap_bio_read_ops = {
> int exfat_iomap_swap_activate(struct swap_info_struct *sis,
> struct file *file, sector_t *span)
> {
> - return iomap_swapfile_activate(sis, file, span, &exfat_iomap_ops);
> + return iomap_swapfile_activate(sis, file, span,
> + &exfat_swap_iomap_ops);
> }
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 22+ messages in thread
end of thread, other threads:[~2026-08-26 7:41 UTC | newest]
Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-08 15:52 [LTP] [PATCH v1 1/1] swap: Add exfat to filesystems requiring tst_fill_file Jan Polensky
2026-06-08 16:29 ` [LTP] " linuxtestproject.agent
2026-06-09 9:19 ` [LTP] [PATCH v1 1/1] " Cyril Hrubis
2026-06-09 14:17 ` Jan Polensky
2026-06-12 9:06 ` Andrea Cervesato via ltp
2026-06-12 9:07 ` Cyril Hrubis
2026-06-17 13:56 ` Andrea Cervesato via ltp
2026-06-17 14:59 ` Andrea Cervesato via ltp
2026-06-17 15:19 ` Andrea Cervesato via ltp
2026-06-18 11:53 ` Jan Polensky
2026-06-18 12:04 ` Andrea Cervesato via ltp
2026-06-18 14:47 ` Jan Polensky
2026-06-18 14:57 ` Andrea Cervesato via ltp
2026-07-02 10:10 ` Andrea Cervesato via ltp
2026-07-07 9:59 ` Jan Polensky
2026-08-25 11:27 ` Petr Vorel
2026-08-25 12:17 ` Andrea Cervesato via ltp
2026-08-25 13:08 ` Cyril Hrubis
2026-08-25 13:26 ` Petr Vorel
2026-08-25 13:46 ` Cyril Hrubis
2026-08-26 0:23 ` Namjae Jeon via ltp
2026-08-26 7:41 ` Petr Vorel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox