Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1408814ybn; Wed, 25 Sep 2019 17:58:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqwZ7qyMv2Vi4UM+TmwaXkF0VcYMWWPsneceocJYMPb5LfGtACRP2goBrKcAm0IzMif6TXIT X-Received: by 2002:a50:a5f8:: with SMTP id b53mr875491edc.39.1569459505373; Wed, 25 Sep 2019 17:58:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569459505; cv=none; d=google.com; s=arc-20160816; b=eq+FsX4enq2tV9dI2MqVfAZhFC7TmXHYy9Taq+AXVOGeYHKshkLAI5QLjIhkgvnNvX B9GUhxZvyGrRn+xeB4iYibiyeW6Vz7lEdMqB3sxThnvCJtvg5rqj3D3pLdSbuA710dac +xUSHWBtfRcVyMIJDGGurR91LpUys9SLAZxxtu1Az+OR2K0TdAsveDYrNb89k9RXFixE B1nO1CccB40XRhiGIXlwDYShtxhlP1nX9ts8EmM45MG/7uD4PZSw2VaJGkUZR9UQoxw+ 3ZJhug6BeCbnTstwCDvY9RNKaK3NXKaNELDIrxsEdWhBMuIHO3ZmDR2PgZhy9jhGpU+X eQzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=LuhEJIGDNuslEYAR3tQgrZrvuZQk7e81nr4rWARzSV4=; b=dWZkZqN27B3V9y5hH+mMdD9v9jqRff7jrq/hQfixYd+Oj50tOVZtswNdm7e3e2Sk3I LDCI7t2F+LrUFEOjuxgRDQMa4LhdLHQlY5ANTSW3d0SEuRBhvzHpKnkikV7refu+mDI4 2TDz1per+A+0mnvBDyHJAIjA+ygEV1MAjOO6aR/ALkV8IbPdl8ZE93WOgw9VfS/KsRBM ++Ue3YQjs1HNuzzQkGcZ36jlORmvT2NcUfBtia75bTkwuBiKi7psjYethnnzcKLErJJE dpHzNnRRWKI0zQQxSLjyhXUStPUe+PTAwowxY18yXg4wfS9Y2+p8P372IkP6GhN/96+V SLeQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d24si417360ede.119.2019.09.25.17.58.01; Wed, 25 Sep 2019 17:58:25 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2504245AbfIXJdn (ORCPT + 99 others); Tue, 24 Sep 2019 05:33:43 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:2711 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2405224AbfIXJdn (ORCPT ); Tue, 24 Sep 2019 05:33:43 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 4C6155CFB229BD2C1AE5; Tue, 24 Sep 2019 17:33:41 +0800 (CST) Received: from huawei.com (10.90.53.225) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.439.0; Tue, 24 Sep 2019 17:33:34 +0800 From: Zhihao Cheng To: , , , , CC: , , Subject: [PATCH xfstests] overlay: Enable character device to be the base fs partition Date: Tue, 24 Sep 2019 17:40:25 +0800 Message-ID: <1569318025-36831-1-git-send-email-chengzhihao1@huawei.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.90.53.225] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- common/config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/config b/common/config index 4c86a49..a22acdb 100644 --- a/common/config +++ b/common/config @@ -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" -- 2.7.4