Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp14490770pxu; Tue, 5 Jan 2021 03:04:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJxnFAkTpZf1eYKNUfrdv07YKIWx3t4VeeWETAnjm1sxjPOf1i4l+IC2zlaxA+wDwqunGhZB X-Received: by 2002:a50:8b02:: with SMTP id l2mr60014102edl.322.1609844670912; Tue, 05 Jan 2021 03:04:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609844670; cv=none; d=google.com; s=arc-20160816; b=vI38LuiMlrbB2Rfq1fMXF6p1BFvbLMn/W3cOoYs5CYy9T/nbW6wj+xfUzYkF28BcRE K9AzDj4m5ljBTxB9SkPJdTek59ffwvdWveKEg+wnQP2iARFoNALH9hkWiWbLnwnHBSUD 0IX5/LQcIcwiq4nWHZDaNhAO0TAnbiaKJfeOXMn27M56BvHPNA8Ocf2zDF10XVXcN4MF WVlWySSsP75/9W7oD6oo3GQ7DjHq2B5uQVbaFLNHxZ2bTArTSQQIIem4+t4Y/G0nEpWl eU7qkEytLoSiFLNhRV67Z8wryfg1Xv4H78X7IJQpNlOOxznoj4ywFdkMtnNITOfLBl6v T+xQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=p15zEV4D+9XYfzCqfaNsH+8wxq6VnaBwWqF0rU+ciI4=; b=RCGGykj0BsTzFz4W7cXfmwtGO/tGuxFHT5RBnX8Mt5md/qhKr3sQtBeF8HS0Jg7NLX S8zqDcAfzFHZ9gJbs1H3AB9WdpNt+3g6jqBygXtKNlFl/cJuuSYA8GjXHhoSSDRfvBI6 MSjldnaydIUPlGp25op+7GnHnR5bwUdjHJ/EEZQFYwN6EbZkSWyuW5OvAqSK3hBumNit 0UIYXHJP3Cua1jOjWx2rh/nBCX+jA2wGT73I9l86vbEPwXRx2PLS5h+72UVinEHVBwdF 2yTeHAdJMQAvganCMbDU9Sn+E6tfVePCjC1ZnRfn7dUwq+pPuhYhJ8B55tzPd3ZjyB67 6ENg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=XbNtsGo8; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z17si30298446ejf.132.2021.01.05.03.04.02; Tue, 05 Jan 2021 03:04:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=XbNtsGo8; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728507AbhAELCF (ORCPT + 99 others); Tue, 5 Jan 2021 06:02:05 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:11240 "EHLO mx0b-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728175AbhAELCD (ORCPT ); Tue, 5 Jan 2021 06:02:03 -0500 Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 105AVu1N038618; Tue, 5 Jan 2021 06:01:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=p15zEV4D+9XYfzCqfaNsH+8wxq6VnaBwWqF0rU+ciI4=; b=XbNtsGo8Kv4SQzajQLMR7i094c9kAgLbaCReqWihrI44V7OG/ubRO9wjyvmK8gN3fkek SbU4IvwekjZg2g0sXhkegLRMdNfGtp/KedcyJNIrWjHnkuHXmaFlKk5DKdIws8gA0+dX U6zfb60ZOBOJ/zJQ7lxkV3ffkNfjaFZGI+dBmaGMDnlS7MU8eQQyLAD+GGzHENPgp6FX LTB8V5fw/JnpY2ybUKUeDC8DHBmkT00KVkEah5NolfV7/5P/tUHIzpiomH1cSULK8kO/ nTlvOHk3+2cCDerfaQGVxNqcBpvXXc6ZkRIAony8DoHeF/I0uyOfIONWV0HiG1S/RhG7 kQ== Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 35vp6s9324-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 05 Jan 2021 06:01:16 -0500 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 105AwRLF003340; Tue, 5 Jan 2021 11:00:31 GMT Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by ppma03ams.nl.ibm.com with ESMTP id 35tgf8assu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 05 Jan 2021 11:00:31 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 105B0TvI48759162 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 5 Jan 2021 11:00:29 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0B5B7A4066; Tue, 5 Jan 2021 11:00:29 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BE854A407A; Tue, 5 Jan 2021 11:00:27 +0000 (GMT) Received: from [9.199.32.130] (unknown [9.199.32.130]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 5 Jan 2021 11:00:27 +0000 (GMT) Subject: Re: [PATCHv2 1/2] common/rc: Add whitelisted FS support in _require_scratch_swapfile() To: "Darrick J. Wong" , Eryu Guan Cc: fstests@vger.kernel.org, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, anju@linux.vnet.ibm.com References: <3bd1f738-93b7-038d-6db9-7bf6a330b1ea@linux.ibm.com> <20201220153906.GC3853@desktop> <20210104182545.GF6908@magnolia> From: Ritesh Harjani Message-ID: <24b16894-0ab5-b769-d05e-e55fa334706e@linux.ibm.com> Date: Tue, 5 Jan 2021 16:30:27 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20210104182545.GF6908@magnolia> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.343,18.0.737 definitions=2021-01-05_01:2021-01-05,2021-01-05 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 clxscore=1015 lowpriorityscore=0 impostorscore=0 phishscore=0 malwarescore=0 priorityscore=1501 adultscore=0 bulkscore=0 spamscore=0 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101050061 Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On 1/4/21 11:55 PM, Darrick J. Wong wrote: > On Sun, Dec 20, 2020 at 11:39:06PM +0800, Eryu Guan wrote: >> On Wed, Dec 16, 2020 at 10:53:45AM +0530, Ritesh Harjani wrote: >>> >>> >>> On 12/16/20 10:47 AM, Ritesh Harjani wrote: >>>> Filesystems e.g. ext4 and XFS supports swapon by default and an error >>>> returned with swapon should be treated as a failure. Hence >>>> add ext4/xfs as whitelisted fstype in _require_scratch_swapfile() >>>> >>>> Signed-off-by: Ritesh Harjani >>>> --- >>>> v1->v2: Addressed comments from Eryu @[1] >>>> [1]: https://patchwork.kernel.org/project/fstests/cover/cover.1604000570.git.riteshh@linux.ibm.com/ >>>> >>>> common/rc | 20 ++++++++++++++++---- >>>> 1 file changed, 16 insertions(+), 4 deletions(-) >>>> >>>> diff --git a/common/rc b/common/rc >>>> index 33b5b598a198..635b77a005c6 100644 >>>> --- a/common/rc >>>> +++ b/common/rc >>>> @@ -2380,6 +2380,7 @@ _format_swapfile() { >>>> # Check that the filesystem supports swapfiles >>>> _require_scratch_swapfile() >>>> { >>>> + local fstyp=$FSTYP >>>> _require_scratch >>>> _require_command "$MKSWAP_PROG" "mkswap" >>>> >>>> @@ -2401,10 +2402,21 @@ _require_scratch_swapfile() >>>> # Minimum size for mkswap is 10 pages >>>> _format_swapfile "$SCRATCH_MNT/swap" $(($(get_page_size) * 10)) >>>> >>>> - if ! swapon "$SCRATCH_MNT/swap" >/dev/null 2>&1; then >>>> - _scratch_unmount >>>> - _notrun "swapfiles are not supported" >>>> - fi >>>> + # For whitelisted fstyp swapon should not fail. > > I would use a different phase than 'whitelisted', since that doesn't > tell us why ext4 and xfs are special: > > # ext* and xfs have supported all variants of swap files since their > # introduction, so swapon should not fail. Sounds ok to me. > >>>> + case "$fstyp" in > > $FSTYP, not $fstyp sure I will use $FSTYP directly and remove local fstyp variable. > >>>> + ext4|xfs) > > I would also add a few more FSTYPs here, since at least ext2 and ext3 > supported swap files. Are there other old fses that do? Sure, agreed. I will add ext2 & ext3 too. -ritesh