From patchwork Mon Jan 11 13:22:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Filipe Manana X-Patchwork-Id: 8003351 Return-Path: X-Original-To: patchwork-fstests@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1E9E5BEEE5 for ; Mon, 11 Jan 2016 13:22:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3BADD202FE for ; Mon, 11 Jan 2016 13:22:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A3A3420303 for ; Mon, 11 Jan 2016 13:22:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758944AbcAKNWn (ORCPT ); Mon, 11 Jan 2016 08:22:43 -0500 Received: from mail.kernel.org ([198.145.29.136]:38323 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758459AbcAKNWm (ORCPT ); Mon, 11 Jan 2016 08:22:42 -0500 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1EC8A202E9; Mon, 11 Jan 2016 13:22:41 +0000 (UTC) Received: from debian3.lan (bl8-199-62.dsl.telepac.pt [85.241.199.62]) (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0AECD202DD; Mon, 11 Jan 2016 13:22:38 +0000 (UTC) From: fdmanana@kernel.org To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org, Filipe Manana Subject: [PATCH v3] fstests: fix btrfs test failures after commit 27d077ec0bda Date: Mon, 11 Jan 2016 13:22:27 +0000 Message-Id: <1452518547-4109-1-git-send-email-fdmanana@kernel.org> X-Mailer: git-send-email 2.1.3 X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Filipe Manana Commit 27d077ec0bda (common: use mount/umount helpers everywhere) made a few btrfs tests fail (btrfs/003 and btrfs/011). These tests create filesystems with multiple devices and test the device replace feature, which need to unmount using the mount path ($SCRATCH_MNT) because unmounting using one of the devices as an argument ($SCRATCH_DEV) does not always work - after replace operations we get in /proc/mounts a device other than $SCRATCH_DEV associated with the mount point $SCRATCH_MNT (this is mentioned in a comment at btrfs/011 for example), so we need to pass that other device to the umount program or pass it the mount point. Fix this by making _sctatch_unmount() pass $SCRATCH_MNT to umount instead of $SCRATCH_DEV (when the filesystem being tested is btrfs). Signed-off-by: Filipe Manana --- V2: Change _sctatch_unmount() to pass $SCRATCH_MNT as the argument to the umount program instead of $SCRATCH_DEV. This makes the btrfs tests pass again. V3: Pass $SCRATCH_MNT to the umount program instead of $SCRATCH_DEV only if the filesystem being tested is btrfs. This was making generic/050 fail (which I couldn't test using btrfs because btrfs does not have the shutdown feature unlike xfs for e.g.). common/rc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/common/rc b/common/rc index 5135260..cbf1854 100644 --- a/common/rc +++ b/common/rc @@ -316,11 +316,17 @@ _scratch_mount() _scratch_unmount() { - if [ "$FSTYP" == "overlay" ]; then + case "$FSTYP" in + overlay) _overlay_scratch_unmount - else + ;; + btrfs) + $UMOUNT_PROG $SCRATCH_MNT + ;; + *) $UMOUNT_PROG $SCRATCH_DEV - fi + ;; + esac } _scratch_remount()