From patchwork Mon Dec 26 04:57:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 9488443 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 3685D60839 for ; Mon, 26 Dec 2016 04:58:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2A8882003F for ; Mon, 26 Dec 2016 04:58:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1BC742022C; Mon, 26 Dec 2016 04:58:56 +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 9BB8D2003F for ; Mon, 26 Dec 2016 04:58:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754781AbcLZE61 (ORCPT ); Sun, 25 Dec 2016 23:58:27 -0500 Received: from cn.fujitsu.com ([222.73.24.84]:3767 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1754047AbcLZE60 (ORCPT ); Sun, 25 Dec 2016 23:58:26 -0500 X-IronPort-AV: E=Sophos;i="5.20,367,1444665600"; d="scan'208";a="1036437" Received: from unknown (HELO cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 26 Dec 2016 12:58:05 +0800 Received: from localhost.localdomain (unknown [10.167.226.34]) by cn.fujitsu.com (Postfix) with ESMTP id 60DC241B4BD0; Mon, 26 Dec 2016 12:58:02 +0800 (CST) From: Qu Wenruo To: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org Subject: [PATCH] fstests: btrfs/132: Use better method to wait the writer to avoid EBUSY Date: Mon, 26 Dec 2016 12:57:52 +0800 Message-Id: <20161226045752.19979-1-quwenruo@cn.fujitsu.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 X-yoursite-MailScanner-ID: 60DC241B4BD0.ACF70 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: quwenruo@cn.fujitsu.com Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The kill and wait method will only wait for the children process to exit, while the xfs_io can still run at background. This makes the test always fails on HDD backed physical machine. Use the "while ps aux | grep" method in btrfs/069 to truely wait the xfs_io to finish. Signed-off-by: Qu Wenruo --- tests/btrfs/132 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/btrfs/132 b/tests/btrfs/132 index 0516177..db0dcb0 100755 --- a/tests/btrfs/132 +++ b/tests/btrfs/132 @@ -94,9 +94,10 @@ sleep $sleep_time kill $pids wait -# Sync the fs to avoid EBUSY while umount, which is quite common for btrfs -# compression -sync +# Wait all writers really exits +while ps aux | grep "$SCRATCH_MNT" | grep -qv grep; do + sleep 1 +done echo "Silence is golden" status=0