Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3576522pxu; Sun, 20 Dec 2020 07:40:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJxO78Rg8FZSIbg/spYHA9lEzm0b+anMOnCu4NkXuoPqjJhuTOANaB5g908EwCeWfvsSUO6Y X-Received: by 2002:aa7:d354:: with SMTP id m20mr12549030edr.195.1608478837229; Sun, 20 Dec 2020 07:40:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608478837; cv=none; d=google.com; s=arc-20160816; b=jbvh5u99s0qdicfSPGj8rYzBKkqpJIuJjMApkatkGzoCXcx9QHLwoRiOzZMYpfTQwF 5UScD7Vm5cYcr8ZePf0dOisIhm7E4Le4/mmacOdV3MWS6uVJuQTQXxHKFa2kYCKLZful XD/G6YX5M/FoB2td74c/XhvVpK2OgNvJ12S1lDEPhJY1xsz+klsxcZVrJ6vQvIdXcxHh qE+tDqMdlJmteljsgfxh730QF9gddlSH2gTOqmQl0FqHMlSpWmWIAh8m1C/5UcvaojCq NlmjvhmmdL2q4ATpSEZOhGT+D2wQoYceEhXRQ8PotccdkSBG7odIjuadLHLmQDAVoVzL acIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=SiPgFN+v6mClCXoIoJkJrCuRBltFRV86fZIfdaju7WI=; b=BMhZHMTJ4UT2VplnlWv6wD7E4yX5DVQRWJTlFiy72W6fcip4AezudGIqj+fzRy3Vj/ zNKMjp7pQLP97dkBBSFKJHhJBzolvXvw2BCS444Lb8WL2gAYJj2K85FfT0hdkrc7Mn05 o+Dq86l901Z2T8ZyfrP9PLEGAr1pj0CgYMq0awFOGTwJlXU3f+ohTeJAh1PqfDZaIZ9D clijOjackfKEyBi06VXSZ/Wk9CY+vgaAa4y9TcaGCyPnGUlED1OLCR/GX6Vf60A5uRmo UavSdYSGveaN2z7pManIy3iSAtve769+5CI+xxkqX1+R5tC3NzYpggifkG3zRSjPmqi8 83Eg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a6si7571539ejy.167.2020.12.20.07.40.12; Sun, 20 Dec 2020 07:40:37 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727661AbgLTPjw (ORCPT + 99 others); Sun, 20 Dec 2020 10:39:52 -0500 Received: from out20-50.mail.aliyun.com ([115.124.20.50]:36277 "EHLO out20-50.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727667AbgLTPjw (ORCPT ); Sun, 20 Dec 2020 10:39:52 -0500 X-Alimail-AntiSpam: AC=CONTINUE;BC=0.074958|-1;CH=green;DM=|CONTINUE|false|;DS=CONTINUE|ham_regular_dialog|0.0155462-0.00128685-0.983167;FP=0|0|0|0|0|-1|-1|-1;HT=ay29a033018047202;MF=guan@eryu.me;NM=1;PH=DS;RN=5;RT=5;SR=0;TI=SMTPD_---.J9OH26p_1608478746; Received: from localhost(mailfrom:guan@eryu.me fp:SMTPD_---.J9OH26p_1608478746) by smtp.aliyun-inc.com(10.147.41.120); Sun, 20 Dec 2020 23:39:06 +0800 Date: Sun, 20 Dec 2020 23:39:06 +0800 From: Eryu Guan To: Ritesh Harjani Cc: fstests@vger.kernel.org, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, anju@linux.vnet.ibm.com Subject: Re: [PATCHv2 1/2] common/rc: Add whitelisted FS support in _require_scratch_swapfile() Message-ID: <20201220153906.GC3853@desktop> References: <3bd1f738-93b7-038d-6db9-7bf6a330b1ea@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3bd1f738-93b7-038d-6db9-7bf6a330b1ea@linux.ibm.com> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org 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. > > + case "$fstyp" in > > + ext4|xfs) > > + if ! swapon "$SCRATCH_MNT/swap" >/dev/null 2>&1; then > > + _scratch_unmount > > + _fail "swapon failed for $fstyp" > > @Eryu, > As of now I added _fail() if swapon failed for given whitelisting fstype. > Do you think this is alright, or should I just ignore the error in I think it's reasonable. But I'd like to leave the patchset on the list for review for another week, to see if ext4 and/or xfs folks will chime in and have different thoughts. Thanks, Eryu > case of such FS? > > > > > + fi > > + ;; > > + *) > > + if ! swapon "$SCRATCH_MNT/swap" >/dev/null 2>&1; then > > + _scratch_unmount > > + _notrun "swapfiles are not supported" > > + fi > > + ;; > > + esac > > > > swapoff "$SCRATCH_MNT/swap" >/dev/null 2>&1 > > _scratch_unmount > > -- > > 2.26.2 > >