From patchwork Fri Jul 6 06:01:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 10510767 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 9D57F601C0 for ; Fri, 6 Jul 2018 05:58:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E62D28426 for ; Fri, 6 Jul 2018 05:58:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8285C2842D; Fri, 6 Jul 2018 05:58:44 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable 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 2468F28426 for ; Fri, 6 Jul 2018 05:58:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934450AbeGFF6i (ORCPT ); Fri, 6 Jul 2018 01:58:38 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:43392 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934247AbeGFF6g (ORCPT ); Fri, 6 Jul 2018 01:58:36 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w665t17w047883; Fri, 6 Jul 2018 05:58:35 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2017-10-26; bh=/Vu+dfAGWjoBrHh2q1mHSIA3n4V9zFJvqBBZbpVuma8=; b=VSsiAMF7cASBGMGKfPmgvP4wi4eJu2OERry/5nbNerpkAcL7qYrXzq+dJsTBWRxivZJM RV24gyswGPBTw6v+9KYiNNrjo6macCvXRyOJh9DYWWeqMTFYylzh2Jb7LvuPtihV1VTs CBDk3fTqacpO7gxIwqp9mXAxN+xhp++jo0OSxhEYn4yOK7Br3VQDpFc3piohbRkrFQir vps619tNKdIzqzIR60/LCG+IykIaU5ZSwv1hekDNo13IBADHzSXYSdd91cbHkexgZnZz 3LP7F/W+vsDB307K+CiORvkoqZ7AFop/QFl5ppCwVoMbOqMXUdqt3GuXnpFnCqZlRXnO kQ== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2130.oracle.com with ESMTP id 2k0dnjr9kt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 06 Jul 2018 05:58:35 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w665wYhM014900 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 6 Jul 2018 05:58:34 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w665wYdg001374; Fri, 6 Jul 2018 05:58:34 GMT Received: from tp.oracle.com (/192.188.170.104) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 05 Jul 2018 22:58:34 -0700 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org Subject: [PATCH v2] fstests: btrfs/168 verify device ready after device delete Date: Fri, 6 Jul 2018 14:01:37 +0800 Message-Id: <20180706060137.1672-1-anand.jain@oracle.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20180703084753.21116-1-anand.jain@oracle.com> References: <20180703084753.21116-1-anand.jain@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8945 signatures=668704 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=13 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807060064 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This test case verifies if the device ready return success after the device delete. Signed-off-by: Anand Jain --- v1->v2: use _run_btrfs_util_prog instead of open coding it. tests/btrfs/168 | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/btrfs/168.out | 2 ++ tests/btrfs/group | 1 + 3 files changed, 71 insertions(+) create mode 100755 tests/btrfs/168 create mode 100644 tests/btrfs/168.out diff --git a/tests/btrfs/168 b/tests/btrfs/168 new file mode 100755 index 000000000000..0d3e99839209 --- /dev/null +++ b/tests/btrfs/168 @@ -0,0 +1,68 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (C) 2018 Oracle. All Rights Reserved. +# +# FS QA Test 168 +# +# Test if btrfs is still reported ready after the device delete +# +# This could be fixed by the following kernel commit: +# btrfs: fix missing superblock update in the device delete commit transaction +# +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -f $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter + +# remove previous $seqres.full before test +rm -f $seqres.full + +# real QA test starts here + +# Modify as appropriate. +_supported_fs btrfs +_supported_os Linux +_require_command "$BTRFS_TUNE_PROG" btrfstune +_require_scratch_dev_pool 2 + +_scratch_dev_pool_get 2 +dev_1=$(echo $SCRATCH_DEV_POOL | awk '{print $1}') +dev_2=$(echo $SCRATCH_DEV_POOL | awk '{print $2}') + +# normal delete device and then check for ready +run_check _scratch_pool_mkfs "-d single -m single" +_scratch_mount +_run_btrfs_util_prog device delete $dev_1 $SCRATCH_MNT +_run_btrfs_util_prog device ready $dev_2 + +_scratch_unmount +# delete a seed device and then check for ready +run_check $BTRFS_TUNE_PROG -S 1 $dev_2 +run_check _mount $dev_2 $SCRATCH_MNT +_run_btrfs_util_prog device add -f $dev_1 $SCRATCH_MNT +run_check mount -o rw,remount $dev_1 $SCRATCH_MNT +_run_btrfs_util_prog device delete $dev_2 $SCRATCH_MNT +_run_btrfs_util_prog device ready $dev_1 + +_scratch_unmount +_scratch_dev_pool_put + +echo "Silence is golden" + +# success, all done +status=0 +exit diff --git a/tests/btrfs/168.out b/tests/btrfs/168.out new file mode 100644 index 000000000000..893a41d859c8 --- /dev/null +++ b/tests/btrfs/168.out @@ -0,0 +1,2 @@ +QA output created by 168 +Silence is golden diff --git a/tests/btrfs/group b/tests/btrfs/group index 5cff3bd6cc03..7bc3ea457992 100644 --- a/tests/btrfs/group +++ b/tests/btrfs/group @@ -170,3 +170,4 @@ 165 auto quick subvol 166 auto quick qgroup 167 auto quick replace volume +168 auto quick volume