From patchwork Tue Nov 14 10:54:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eryu Guan X-Patchwork-Id: 10057359 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 16F5C6056E for ; Tue, 14 Nov 2017 10:55:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1263D293F9 for ; Tue, 14 Nov 2017 10:55:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0763829409; Tue, 14 Nov 2017 10:55:16 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 A71BC293F9 for ; Tue, 14 Nov 2017 10:55:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755045AbdKNKzG (ORCPT ); Tue, 14 Nov 2017 05:55:06 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50208 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754114AbdKNKyw (ORCPT ); Tue, 14 Nov 2017 05:54:52 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 755573D945; Tue, 14 Nov 2017 10:54:52 +0000 (UTC) Received: from localhost (dhcp-12-147.nay.redhat.com [10.66.12.147]) by smtp.corp.redhat.com (Postfix) with ESMTP id EFC7DA1026; Tue, 14 Nov 2017 10:54:51 +0000 (UTC) From: Eryu Guan To: fstests@vger.kernel.org Cc: misono.tomohiro@jp.fujitsu.com, linux-xfs@vger.kernel.org, Eryu Guan Subject: [PATCH 2/3] overlay/036: filter busy mount message Date: Tue, 14 Nov 2017 18:54:00 +0800 Message-Id: <20171114105401.10542-3-eguan@redhat.com> In-Reply-To: <20171114105401.10542-1-eguan@redhat.com> References: <20171114105401.10542-1-eguan@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 14 Nov 2017 10:54:52 +0000 (UTC) Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP util-linux v2.30 changed error message of a busy mount and caused overlay/036 to fail. e.g. - mount: is already mounted or busy + mount: : already mounted or mount point busy. Filter the mount output by a newly introduced _filter_busy_mount into a unified format. Signed-off-by: Eryu Guan --- common/filter | 12 ++++++++++++ tests/overlay/036 | 9 +++++++-- tests/overlay/036.out | 4 ++-- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/common/filter b/common/filter index d1bb94818e3d..b1cd558ab0e1 100644 --- a/common/filter +++ b/common/filter @@ -420,6 +420,18 @@ _filter_error_mount() sed -e "s/mount:\(.*failed:\)/mount:/" | _filter_ending_dot } +# Similar to _filter_error_mount, filter a busy mount output. +# Turn both old (prior to util-linux v2.30) and new (v2.30 and later) format to +# a simple one. e.g. +# old: mount: is already mounted or busy +# new: mount: : already mounted or mount point busy. +# filtered: mount: already mounted or mount point busy +_filter_busy_mount() +{ + sed -e "s/.*: \([^ ]*\).* already mounted.*busy/mount: \1 already mounted or mount point busy/" | \ + _filter_ending_dot +} + _filter_od() { BLOCK_SIZE=$(_get_block_size $SCRATCH_MNT) diff --git a/tests/overlay/036 b/tests/overlay/036 index 544d4e4eaa87..4c4b56ff9817 100755 --- a/tests/overlay/036 +++ b/tests/overlay/036 @@ -63,6 +63,11 @@ _cleanup() . ./common/rc . ./common/filter +filter_mount() +{ + _filter_scratch | _filter_busy_mount +} + # remove previous $seqres.full before test rm -f $seqres.full @@ -103,12 +108,12 @@ _overlay_mount_dirs $lowerdir2 $upperdir2 $workdir \ # Try to mount another overlay with the same upperdir # with index=on - expect EBUSY _overlay_mount_dirs $lowerdir2 $upperdir $workdir2 \ - overlay2 $SCRATCH_MNT -oindex=on 2>&1 | _filter_scratch + overlay2 $SCRATCH_MNT -oindex=on 2>&1 | filter_mount # Try to mount another overlay with the same workdir # with index=on - expect EBUSY _overlay_mount_dirs $lowerdir2 $upperdir2 $workdir \ - overlay3 $SCRATCH_MNT -oindex=on 2>&1 | _filter_scratch + overlay3 $SCRATCH_MNT -oindex=on 2>&1 | filter_mount # success, all done diff --git a/tests/overlay/036.out b/tests/overlay/036.out index 51746114db1c..fbe224e1bac7 100644 --- a/tests/overlay/036.out +++ b/tests/overlay/036.out @@ -1,3 +1,3 @@ QA output created by 036 -mount: overlay2 is already mounted or SCRATCH_MNT busy -mount: overlay3 is already mounted or SCRATCH_MNT busy +mount: overlay2 already mounted or mount point busy +mount: overlay3 already mounted or mount point busy