From patchwork Wed Jan 3 14:25:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chengguang Xu X-Patchwork-Id: 10142461 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 068D3601A1 for ; Wed, 3 Jan 2018 14:26:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E9BF128F2C for ; Wed, 3 Jan 2018 14:26:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DE6E7290CD; Wed, 3 Jan 2018 14:26:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC54228F2C for ; Wed, 3 Jan 2018 14:26:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752788AbeACO0V (ORCPT ); Wed, 3 Jan 2018 09:26:21 -0500 Received: from pv33p36im-asmtp002.me.com ([17.142.213.63]:46197 "EHLO pv33p36im-asmtp002.me.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752750AbeACO0U (ORCPT ); Wed, 3 Jan 2018 09:26:20 -0500 Received: from process-dkim-sign-daemon.pv33p36im-asmtp002.me.com by pv33p36im-asmtp002.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) id <0P1Z00H00GP3XZ00@pv33p36im-asmtp002.me.com>; Wed, 03 Jan 2018 14:26:19 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=04042017; t=1514989579; bh=yUeGNQIEcMVtyrcmAKkDlaBFMxpQE9rUoAfEsX9Xa+M=; h=Content-type:MIME-version:Subject:From:Date:Message-id:To; b=flJ1S7SI4JZf/xy8SAFCVJT9st/SkZ6UBYIyh7tBabEQzjePQXYxAR5p7B/SQwzZD r+PC2xpRR9xEhGravvmYQO8Ldwua5gXPf39OFTeKZBqv5fmeNwTdm3q8eTlrJZHry8 H4aXvjMMpJWMgv4wYL8E+L8EzfR7dW/SDI77RYnIDPXGLz+OPwNKorkpDvV9sREoIB iUw/Es0RkOXzHKt75v/rZXxft3cM6USO8BAqT1OBY/o77W1hWjq/HbEI8x7xMzGrUf PpdzjSR3QYeQtSj4A0pvNuzSGdn5+EpKyMDP2Q58YJVHff6CmiR1/tOT3u7kjNpcSC 5ImAAyiU/cKJQ== Received: from icloud.com ([127.0.0.1]) by pv33p36im-asmtp002.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) with ESMTPSA id <0P1Z00KQQHF67S40@pv33p36im-asmtp002.me.com>; Wed, 03 Jan 2018 14:26:16 +0000 (GMT) Content-type: text/plain; charset=gb2312 MIME-version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Subject: Re: [PATCH v3 1/3] common/rc: add scratch shutdown support for overlayfs From: Chengguang Xu In-reply-to: Date: Wed, 03 Jan 2018 22:25:54 +0800 Cc: Eryu Guan , fstests , overlayfs Content-transfer-encoding: quoted-printable Message-id: <698CC47A-DC4A-4705-B112-6AAC36A088A4@icloud.com> References: <1513048179-151065-1-git-send-email-cgxu519@icloud.com> <20171212091622.GQ2749@eguan.usersys.redhat.com> <20171212133911.GU2749@eguan.usersys.redhat.com> To: Amir Goldstein X-Mailer: Apple Mail (2.3445.5.20) Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP > > 在 2018年1月3日,下午8:58,Amir Goldstein 写道: > > On Wed, Jan 3, 2018 at 2:44 PM, Chengguang Xu wrote: >> > [...] >> In order to add overlay support in some requirement checks like _require_metadata_journaling, >> I think it’s better save underlying filesystem type to $OVL_BASE_FSTYP and doing proper check based >> on it. >> >> Currently $OVL_BASE_FSTYP and $FSTYP all set to “overlay”, Is there any specific reason for it? >> > > In _overlay_config_override(): > # Config file may specify base fs type, but we obay -overlay flag > export OVL_BASE_FSTYP="$FSTYP" > export FSTYP=overlay > > So either your setup is wrong or there is a bug. > $OVL_BASE_FSTYP *should* contain the base fs type, > but only if you defined FSTYPE in your config file when running ./check -overlay Yeah, I didn’t specify by hand in config file and just supposed to detect automatically. I didn’t check very carefully but seems just slight modification like below could let it support auto detection. $ git diff Thanks, Chengguang. --- To unsubscribe from this list: send the line "unsubscribe fstests" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/check b/check index f8db3cd..e460424 100755 --- a/check +++ b/check @@ -265,7 +265,7 @@ while [ $# -gt 0 ]; do -nfs) FSTYP=nfs ;; -glusterfs) FSTYP=glusterfs ;; -cifs) FSTYP=cifs ;; - -overlay) FSTYP=overlay; export OVERLAY=true ;; + -overlay) export OVERLAY=true ;; -pvfs2) FSTYP=pvfs2 ;; -tmpfs) FSTYP=tmpfs ;; -ubifs) FSTYP=ubifs ;; diff --git a/common/config b/common/config index d0fbfe5..e21d8ee 100644 --- a/common/config +++ b/common/config @@ -530,7 +530,9 @@ _overlay_config_override() [ -b "$TEST_DEV" ] || return 0 # Config file may specify base fs type, but we obay -overlay flag - export OVL_BASE_FSTYP="$FSTYP" + if [ -z $OVL_BASE_FSTYP ]; then + export OVL_BASE_FSTYP="$FSTYP" + fi export FSTYP=overlay # Store original base fs vars @@ -691,13 +693,6 @@ get_next_config() { _check_device SCRATCH_LOGDEV optional $SCRATCH_LOGDEV fi - # Override FSTYP from config when running ./check -overlay - # and maybe override base fs TEST/SCRATCH_DEV with overlay base dirs. - # We need to do this *after* default mount options are set by base FSTYP - # and *after* SCRATCH_DEV is deduced from SCRATCH_DEV_POOL - if [ "$OVERLAY" == "true" -o "$FSTYP" == "overlay" ]; then - _overlay_config_override - fi } if [ -z "$CONFIG_INCLUDED" ]; then @@ -711,6 +706,15 @@ if [ -z "$CONFIG_INCLUDED" ]; then [ ! -z "$TEST_DEV" ]; then FSTYP=`blkid -c /dev/null -s TYPE -o value $TEST_DEV` fi + + # Override FSTYP from config when running ./check -overlay + # and maybe override base fs TEST/SCRATCH_DEV with overlay base dirs. + # We need to do this *after* default mount options are set by base FSTYP + # and *after* SCRATCH_DEV is deduced from SCRATCH_DEV_POOL + if [ "$OVERLAY" == "true" -o "$FSTYP" == "overlay" ]; then + _overlay_config_override + fi + FSTYP=${FSTYP:=xfs} export FSTYP [ -z "$MOUNT_OPTIONS" ] && _mount_opts