Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1794975ybn; Thu, 26 Sep 2019 02:17:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqx1eHxu8hp4xoNf9JMmfmmn5/Cjj2kK0c13Z8OCKK9FDMrKncUob24YwgVk+oCim5lvnqYG X-Received: by 2002:a05:6402:17ad:: with SMTP id j13mr2433961edy.212.1569489436031; Thu, 26 Sep 2019 02:17:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569489436; cv=none; d=google.com; s=arc-20160816; b=aUFhnfgdnRL3Ukk3pf/UHWb7JM9e8RTtZvBmVTEX+svt/Yd62FUch399gpmIqY3ESt OcpKD3ABD4GoA8V0PLsrRs9Y9mVD4RXv2hR93jtMEzC7hB3nXzBmHbRwG7mLnrSEuWrD 1XogIjqf14zf9W8V0uOtQTmjEH3Il8MpdVOLkA49j8e1ygAOfu6nqIRj6ed9g3EAL3eT 192mKwPySSQCCVzySSbz3svOgG3MBoVqn/TdAQj0BbXfAcfzmtw02w/e8+xbPCx9Tjlo lc//+eD5B5JA+tbXqmZ52wJsV5sklUSeSOn0tOkvLE0l+U0I/t1WWThftYeFowjnnNXE vs3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=UZ3VnberXXl+Q/9IPbdaDqe16sWDnoZalHAnBGlNPH8=; b=X8t9z7m4dG2kj/CvmZJ/SSgZoCP1erH+gD5+oHJy6YTBoAnTSdSbD9VfCpJXVB/s60 nrGfPdCl1k/WbkRj17YeZ3GtoAkAopK315UPV6ACNgoqJo0K3Vzw+j0/jqKyPuwi8Kvh cQBtkJX4//PxvqHHxN8n4DbLP0QvNbaiSBvsvsyN7fQJmnKyx2phx8RDq9b0qwkEYKsG 9JeOZtHAJSTR4qbJsG/XrAYmtB0ZrNzjvpdEYyGG7Qr/dsN4jnupgIhfwKyfHF5DrO+s PclfEDsLqiqQpelMswwPY16SeDnfrLJD5VG30Qcujm1IUGHoVtUU++xlL1GNJh+iImFW 8lcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TcJfabqy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i33si912396eda.205.2019.09.26.02.16.52; Thu, 26 Sep 2019 02:17:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TcJfabqy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2442481AbfIYHSw (ORCPT + 99 others); Wed, 25 Sep 2019 03:18:52 -0400 Received: from mail-yw1-f67.google.com ([209.85.161.67]:45633 "EHLO mail-yw1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2437009AbfIYHSw (ORCPT ); Wed, 25 Sep 2019 03:18:52 -0400 Received: by mail-yw1-f67.google.com with SMTP id x65so407036ywf.12; Wed, 25 Sep 2019 00:18:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=UZ3VnberXXl+Q/9IPbdaDqe16sWDnoZalHAnBGlNPH8=; b=TcJfabqyz1SZlZ3H3wCoCgPLUSGbyvhaiHjoo6CpV54jCbZO/idllgPrhKdSRbkNZQ nCyaJFb+xU1mJUgHhp34wLJ2zTlFgpCORbEyWSZf+MHBdzMzJxHhfp2rf6lUehSjEfTN CPCgcq2zi+o0n6/e7UZctT4P5jWh1+WVuzpUbqeXwLuBeci35/QU66exY+JBfHKQbnO2 Do/UEvudqzHgvecE23eglKK1rf17uS1HUVBR/yUfpAHEfuLsquuUKfzhb67iu+3KFgDu JfCv+xg+oa9dwI6ZF44nGv/SY8TXJY7sJILedZxWBZDpqcP5kXpaIKxxme87+h1gikqq TYxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=UZ3VnberXXl+Q/9IPbdaDqe16sWDnoZalHAnBGlNPH8=; b=qQvZrJrDEgvJ5/616VQ7lmJksXeg/uAd3ozu5dPRgESUS6HJKAckh3H4TbDQpDPeLL HfzJg3u8teW8EjDa1YqXmz7HRXN4ktGOgi1XzU4krnEROvANE3uMHfpngIMbFmxLI2YV J5sSpnb2fJq9ZLAG9rjOuNgyvvaKCgwe1t7+rrJCIBNL8RsZc1CRr9jhiGSzR+CIgPkV 7FuWFab0hFXiuwsSK5cOjmWnmH4BIccdujAFGD4HdDq/+kmG/zhQn+UwkYevg7VtZ2/L pE5RapkcCVtV1yBTVvjRdqhxI0ysNACPRLOC4xKXP+etsbJX1DgQ6rTSk07vDUKrHhlj pZqg== X-Gm-Message-State: APjAAAVqmTIMJt32XS+O53LHxY9MWmy0b7Q3lVQi0Giu98/9yTP9yc0S rm7MG150ylR0+WYLYinIaViyDHHjmW9HtYaFBjE= X-Received: by 2002:a81:54:: with SMTP id 81mr4470004ywa.25.1569395930960; Wed, 25 Sep 2019 00:18:50 -0700 (PDT) MIME-Version: 1.0 References: <1569393333-128141-1-git-send-email-chengzhihao1@huawei.com> In-Reply-To: <1569393333-128141-1-git-send-email-chengzhihao1@huawei.com> From: Amir Goldstein Date: Wed, 25 Sep 2019 10:18:39 +0300 Message-ID: Subject: Re: [PATCH xfstests v3] overlay: Enable character device to be the base fs partition To: Zhihao Cheng Cc: Eryu Guan , David Oberhollenzer , Eric Biggers , "zhangyi (F)" , fstests , linux-kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 25, 2019 at 9:29 AM Zhihao Cheng wrote: > > When running overlay tests using character devices as base fs partitions, > all overlay usecase results become 'notrun'. Function > '_overay_config_override' (common/config) detects that the current base > fs partition is not a block device and will set FSTYP to base fs. The > overlay usecase will check the current FSTYP, and if it is not 'overlay' > or 'generic', it will skip the execution. > > For example, using UBIFS as base fs skips all overlay usecases: > > FSTYP -- ubifs # FSTYP should be overridden as 'overlay' > MKFS_OPTIONS -- /dev/ubi0_1 # Character device > MOUNT_OPTIONS -- -t ubifs /dev/ubi0_1 /tmp/scratch > > overlay/001 [not run] not suitable for this filesystem type: ubifs > overlay/002 [not run] not suitable for this filesystem type: ubifs > overlay/003 [not run] not suitable for this filesystem type: ubifs > > When checking that the base fs partition is a block/character device, > FSTYP is overwritten as 'overlay'. This patch allows the base fs > partition to be a character device that can also execute overlay > usecases (such as ubifs). > > Signed-off-by: Zhihao Cheng > Signed-off-by: Amir Goldstein Looks fine. Eryu, you may change this to Reviewed-by > --- > common/config | 6 +++--- > common/rc | 2 +- > 2 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/common/config b/common/config > index 4c86a49..4eda36c 100644 > --- a/common/config > +++ b/common/config > @@ -532,7 +532,7 @@ _canonicalize_mountpoint() > # When SCRATCH/TEST_* vars are defined in evironment and not > # in config file, this function is called after vars have already > # been overriden in the previous test. > -# In that case, TEST_DEV is a directory and not a blockdev and > +# In that case, TEST_DEV is a directory and not a blockdev/chardev and > # the function will return without overriding the SCRATCH/TEST_* vars. > _overlay_config_override() > { > @@ -550,7 +550,7 @@ _overlay_config_override() > # the new OVL_BASE_SCRATCH/TEST_DEV/MNT vars are set to the values > # of the configured base fs and SCRATCH/TEST_DEV vars are set to the > # overlayfs base and mount dirs inside base fs mount. > - [ -b "$TEST_DEV" ] || return 0 > + [ -b "$TEST_DEV" ] || [ -c "$TEST_DEV" ] || return 0 > > # Config file may specify base fs type, but we obay -overlay flag > [ "$FSTYP" == overlay ] || export OVL_BASE_FSTYP="$FSTYP" > @@ -570,7 +570,7 @@ _overlay_config_override() > export TEST_DIR="$OVL_BASE_TEST_DIR/$OVL_MNT" > export MOUNT_OPTIONS="$OVERLAY_MOUNT_OPTIONS" > > - [ -b "$SCRATCH_DEV" ] || return 0 > + [ -b "$SCRATCH_DEV" ] || [ -c "$SCRATCH_DEV" ] || return 0 > > # Store original base fs vars > export OVL_BASE_SCRATCH_DEV="$SCRATCH_DEV" > diff --git a/common/rc b/common/rc > index 66c7fd4..8d57c37 100644 > --- a/common/rc > +++ b/common/rc > @@ -3100,7 +3100,7 @@ _require_scratch_shutdown() > # SCRATCH_DEV, in this case OVL_BASE_SCRATCH_DEV > # will be null, so check OVL_BASE_SCRATCH_DEV before > # running shutdown to avoid shutting down base fs accidently. > - _notrun "$SCRATCH_DEV is not a block device" > + _notrun "This test requires a valid $OVL_BASE_SCRATCH_DEV as ovl base fs" > else > src/godown -f $OVL_BASE_SCRATCH_MNT 2>&1 \ > || _notrun "Underlying filesystem does not support shutdown" > -- > 2.7.4 >