From patchwork Wed Sep 25 01:54:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhihao Cheng X-Patchwork-Id: 11159905 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D57E81747 for ; Wed, 25 Sep 2019 01:47:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AF296214AF for ; Wed, 25 Sep 2019 01:47:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387402AbfIYBr1 (ORCPT ); Tue, 24 Sep 2019 21:47:27 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:2712 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727329AbfIYBr1 (ORCPT ); Tue, 24 Sep 2019 21:47:27 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 7A9EB1EB01A939B53864; Wed, 25 Sep 2019 09:47:24 +0800 (CST) Received: from huawei.com (10.90.53.225) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.439.0; Wed, 25 Sep 2019 09:47:17 +0800 From: Zhihao Cheng To: , , , , CC: , , Subject: [PATCH xfstests v2] overlay: Enable character device to be the base fs partition Date: Wed, 25 Sep 2019 09:54:08 +0800 Message-ID: <1569376448-53998-1-git-send-email-chengzhihao1@huawei.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.90.53.225] X-CFilter-Loop: Reflected Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org There is a message in _supported_fs(): _notrun "not suitable for this filesystem type: $FSTYP" for when overlay usecases are executed on a chararcter device based base fs. _overay_config_override() detects that the current base fs partition is not a block device, and FSTYP won't be overwritten as 'overlay' before executing usecases which results in all overlay usecases become 'notrun'. In addition, all generic usecases are based on base fs rather than overlay. We want to rewrite FSTYP to 'overlay' before running the usecases. To do this, we need to add additional character device judgments for TEST_DEV and SCRATCH_DEV in _overay_config_override(). 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"