Linux Test Project
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Jan Polensky <japo@linux.ibm.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v1 1/1] swap: Add exfat to filesystems requiring tst_fill_file
Date: Tue, 9 Jun 2026 11:19:19 +0200	[thread overview]
Message-ID: <aifalyMdDVoFT3Tg@yuki.lan> (raw)
In-Reply-To: <20260608155241.270875-1-japo@linux.ibm.com>

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

  parent reply	other threads:[~2026-06-09  9:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2026-06-09 14:17   ` [LTP] [PATCH v1 1/1] " Jan Polensky
2026-06-12  9:06     ` Andrea Cervesato via ltp
2026-06-12  9:07       ` Cyril Hrubis

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=aifalyMdDVoFT3Tg@yuki.lan \
    --to=chrubis@suse.cz \
    --cc=japo@linux.ibm.com \
    --cc=ltp@lists.linux.it \
    /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