lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b640a61c-6bcb-421e-9dc7-9dff76163dc9@huawei.com>
Date: Thu, 13 Nov 2025 09:51:28 +0800
From: Baokun Li <libaokun1@...wei.com>
To: "Darrick J. Wong" <djwong@...nel.org>, Theodore Ts'o <tytso@....edu>
CC: <zlang@...hat.com>, <neal@...pa.dev>, <fstests@...r.kernel.org>,
	<linux-ext4@...r.kernel.org>, <linux-fsdevel@...r.kernel.org>,
	<joannelkoong@...il.com>, <bernd@...ernd.com>
Subject: Re: [PATCH v6.1 04/33] common/rc: skip test if swapon doesn't work

On 2025-11-13 06:29, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@...nel.org>
>
> In _require_scratch_swapfile, skip the test if swapon fails for whatever
> reason, just like all the other filesystems.  There are certain ext4
> configurations where swapon isn't supported, such as S_DAX files on
> pmem, and (for now) blocksize > pagesize filesystems.
>
> Signed-off-by: "Darrick J. Wong" <djwong@...nel.org>

Looks good to me. Thanks for the patch!

Reviewed-by: Baokun Li <libaokun1@...wei.com>

> ---
> v6.1: clobber all the ext-specific stuff
> ---
>  common/rc |   25 ++++---------------------
>  1 file changed, 4 insertions(+), 21 deletions(-)
>
> diff --git a/common/rc b/common/rc
> index b62e21f778d938..564235ea2e995c 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -3268,27 +3268,10 @@ _require_scratch_swapfile()
>  	# Minimum size for mkswap is 10 pages
>  	_format_swapfile "$SCRATCH_MNT/swap" $(($(_get_page_size) * 10)) > /dev/null
>  
> -	# ext* has supported all variants of swap files since their
> -	# introduction, so swapon should not fail.
> -	case "$FSTYP" in
> -	ext2|ext3|ext4)
> -		if ! swapon "$SCRATCH_MNT/swap" >/dev/null 2>&1; then
> -			if _check_s_dax "$SCRATCH_MNT/swap" 1 >/dev/null; then
> -				_scratch_unmount
> -				_notrun "swapfiles are not supported"
> -			else
> -				_scratch_unmount
> -				_fail "swapon failed for $FSTYP"
> -			fi
> -		fi
> -		;;
> -	*)
> -		if ! swapon "$SCRATCH_MNT/swap" >/dev/null 2>&1; then
> -			_scratch_unmount
> -			_notrun "swapfiles are not supported"
> -		fi
> -		;;
> -	esac
> +	if ! swapon "$SCRATCH_MNT/swap" >/dev/null 2>&1; then
> +		_scratch_unmount
> +		_notrun "swapon failed for $FSTYP"
> +	fi
>  
>  	swapoff "$SCRATCH_MNT/swap" >/dev/null 2>&1
>  	_scratch_unmount
>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ