From patchwork Mon Dec 19 18:45:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 9480667 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 DF061601C0 for ; Mon, 19 Dec 2016 18:46:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D9232283FF for ; Mon, 19 Dec 2016 18:46:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CDB8E28462; Mon, 19 Dec 2016 18:46:19 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 70CA9283FF for ; Mon, 19 Dec 2016 18:46:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932519AbcLSSqN (ORCPT ); Mon, 19 Dec 2016 13:46:13 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:33790 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932546AbcLSSp7 (ORCPT ); Mon, 19 Dec 2016 13:45:59 -0500 Received: by mail-pg0-f67.google.com with SMTP id g1so7439750pgn.0 for ; Mon, 19 Dec 2016 10:45:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=cfY4vp1oGpqjuthgbCdVoHHUzRUX/cD3IdoBWIwPqJ0=; b=T/c+P3wEjXxwC77rxckZtSuIjbS4NJZ53EmTuwunAOvc/XvKmE2vmd0mWzICWs9l5j opMbZ1skH9lCtS/T7JbWQ7Wjcxi3gVjVdBcDyNLItuFpDF/O9VhCtAbQbwMf2vvJpy4N hkjh0CNuSWysKK3J3BZYVWZcxO7usaD525GFXiQHt39G9qi4TpwrPbd5eJ7UZNgRrZmC iyPGuYqverLtJep5uOVw8S4Nde/hdNohi8CvmIv5FndjrJ7gG4x2qWYm4jGdPAI0gI1+ Mq3eJtfNEStpOQMXIIGXUT42JDTiwljWkrhDWd1ZZ7t2NUmL55hWBXPkenY8B5yd8UA/ gPyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=cfY4vp1oGpqjuthgbCdVoHHUzRUX/cD3IdoBWIwPqJ0=; b=GW99ucd6mzQVRighPElqND5frLdy/TlGvm3xPHmu6ljuUwt7S4U1FbZuT8zaFQZz7C jE8h6G6RenjIodiOMKXJW8yJYpWxxi8oSjtjazmCMSJL0/c1JOn+xoEZyrzBtRXLJlYA aLqQO/Df9SXpYRscOtlT1prdXVxiKn6EkWJ/SIZabIhcd2MqxK75iT/jqC3J9hdxRmd1 /Rg1rB8LT+LZVy2iKpB20aYmAqBiv5LnVUFsXtHBxdxivDhArqFijJe3XsyaDOODvzO9 v1o/XX+HzvvMkURuzR74a+Qs1xXfnTpKKi8JimDeH6TD1+FkhtE2056pBRztsXDtFcCb MyAg== X-Gm-Message-State: AKaTC036LY/4vP6FjE+xsxYXhwBtUf5ccsgy0BxqarQYB/2gY6HbqYfB92cjBgcxwaDiuQ== X-Received: by 10.84.131.165 with SMTP id d34mr37873011pld.41.1482173159092; Mon, 19 Dec 2016 10:45:59 -0800 (PST) Received: from ebiggers-linuxstation.kir.corp.google.com ([100.119.30.131]) by smtp.gmail.com with ESMTPSA id r26sm28154871pgd.42.2016.12.19.10.45.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 19 Dec 2016 10:45:58 -0800 (PST) From: Eric Biggers To: fstests@vger.kernel.org Cc: linux-mtd@lists.infradead.org, Richard Weinberger , David Gstir , "Theodore Y . Ts'o" , Jaegeuk Kim , Eric Biggers Subject: [RFC][PATCH 1/2] xfstests: add experimental support for ubifs Date: Mon, 19 Dec 2016 10:45:31 -0800 Message-Id: <1482173132-100690-2-git-send-email-ebiggers3@gmail.com> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 In-Reply-To: <1482173132-100690-1-git-send-email-ebiggers3@gmail.com> References: <1482173132-100690-1-git-send-email-ebiggers3@gmail.com> Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Eric Biggers This experimental patch adds ubifs support to xfstests. Unlike most filesystems, ubifs is not block-device based. Instead it uses an UBI volume, which is layered above a MTD (raw flash) device. An UBI volume is represented by a char device node, e.g. /dev/ubi0_0. To run xfstests on ubifs, the user must set TEST_DEV to point to an UBI volume formatted as ubifs and SCRATCH_DEV to point to some other UBI volume. Most things seem to just work, but a few changes were needed to allow TEST_DEV and SCRATCH_DEV to be char devices, and to handle the lack of a fsck.ubifs. Signed-off-by: Eric Biggers --- common/config | 7 +++++-- common/rc | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/common/config b/common/config index 6cce7ce..cf01c9e 100644 --- a/common/config +++ b/common/config @@ -331,6 +331,9 @@ _mount_opts() # We need to specify the size at mount, use 1G by default export MOUNT_OPTIONS="-o size=1G $TMPFS_MOUNT_OPTIONS" ;; + ubifs) + export MOUNT_OPTIONS=$UBIFS_MOUNT_OPTIONS + ;; *) ;; esac @@ -461,8 +464,8 @@ _check_device() if [ ! -d "$dev" ]; then _fatal "common/config: $name ($dev) is not a directory for overlay" fi - elif [ ! -b "$dev" -a "$network_dev" != "0" ]; then - _fatal "common/config: $name ($dev) is not a block device or a network filesystem" + elif [ ! -b "$dev" -a ! -c "$dev" -a "$network_dev" != "0" ]; then + _fatal "common/config: $name ($dev) is not a device node or network filesystem" fi } diff --git a/common/rc b/common/rc index 2639fbd..8000abb 100644 --- a/common/rc +++ b/common/rc @@ -1308,6 +1308,15 @@ _require_scratch_nocheck() _notrun "this test requires a valid \$SCRATCH_MNT and unique $SCRATCH_DEV" fi ;; + ubifs) + # ubifs needs an UBI volume. This will be a char device, not a block device. + if [ ! -c "$SCRATCH_DEV" ]; then + _notrun "this test requires a valid UBI volume for \$SCRATCH_DEV" + fi + if [ ! -d "$SCRATCH_MNT" ]; then + _notrun "this test requires a valid \$SCRATCH_MNT" + fi + ;; *) if [ -z "$SCRATCH_DEV" -o "`_is_block_dev "$SCRATCH_DEV"`" = "" ] then @@ -1393,6 +1402,15 @@ _require_test() _notrun "this test requires a valid \$TEST_DIR and unique $TEST_DEV" fi ;; + ubifs) + # ubifs needs an UBI volume. This will be a char device, not a block device. + if [ ! -c "$TEST_DEV" ]; then + _notrun "this test requires a valid UBI volume for \$TEST_DEV" + fi + if [ ! -d "$TEST_DIR" ]; then + _notrun "this test requires a valid \$TEST_DIR" + fi + ;; *) if [ -z "$TEST_DEV" ] || [ "`_is_block_dev "$TEST_DEV"`" = "" ] then @@ -2171,6 +2189,9 @@ _check_test_fs() tmpfs) # no way to check consistency for tmpfs ;; + ubifs) + # there is no fsck program for ubifs yet + ;; *) _check_generic_filesystem $TEST_DEV ;; @@ -2215,6 +2236,9 @@ _check_scratch_fs() tmpfs) # no way to check consistency for tmpfs ;; + ubifs) + # there is no fsck program for ubifs yet + ;; *) _check_generic_filesystem $device ;;