From patchwork Tue Sep 30 15:48:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eryu Guan X-Patchwork-Id: 5004081 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BE49E9F2F0 for ; Tue, 30 Sep 2014 15:50:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DE5FD20200 for ; Tue, 30 Sep 2014 15:50:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DDB02201CE for ; Tue, 30 Sep 2014 15:50:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752181AbaI3Puo (ORCPT ); Tue, 30 Sep 2014 11:50:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42016 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752154AbaI3Pun (ORCPT ); Tue, 30 Sep 2014 11:50:43 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s8UFmBsf029215 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 30 Sep 2014 11:48:11 -0400 Received: from localhost (vpn1-113-79.nay.redhat.com [10.66.113.79]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s8UFmA40009989; Tue, 30 Sep 2014 11:48:10 -0400 Date: Tue, 30 Sep 2014 23:48:09 +0800 From: Eryu Guan To: Josef Bacik Cc: fstests@vger.kernel.org, linux-btrfs@vger.kernel.org Subject: Re: [PATCH v4 01/15] btrfs: new test to run btrfs balance and subvolume test simultaneously Message-ID: <20140930154809.GQ13912@dhcp-13-216.nay.redhat.com> References: <1411704901-12723-1-git-send-email-eguan@redhat.com> <1411704901-12723-2-git-send-email-eguan@redhat.com> <5429AD14.5000805@fb.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <5429AD14.5000805@fb.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.6 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 On Mon, Sep 29, 2014 at 03:03:48PM -0400, Josef Bacik wrote: > On 09/26/2014 12:14 AM, Eryu Guan wrote: > >Run btrfs balance and subvolume create/mount/umount/delete simultaneously, > >with fsstress running in background. > > > >Signed-off-by: Eryu Guan > >--- [snip] > >+ args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir` > >+ echo "Run fsstress $args" >>$seqres.full > >+ $FSSTRESS_PROG $args >/dev/null 2>&1 & > >+ fsstress_pid=$! > >+ > >+ echo -n "Start balance worker: " >>$seqres.full > >+ _btrfs_stress_balance $SCRATCH_MNT >/dev/null 2>&1 & > >+ balance_pid=$! > >+ echo "$balance_pid" >>$seqres.full > >+ > >+ echo -n "Start subvolume worker: " >>$seqres.full > >+ _btrfs_stress_subvolume $SCRATCH_DEV $SCRATCH_MNT subvol_$$ $subvol_mnt >/dev/null 2>&1 & > >+ subvol_pid=$! > >+ echo "$subvol_pid" >>$seqres.full > >+ > >+ echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full > >+ wait $fsstress_pid > >+ > >+ kill $balance_pid $subvol_pid > >+ wait > >+ # wait for the balance operation to finish > >+ while ps aux | grep "balance start" | grep -qv grep; do > >+ sleep 1 > >+ done > > This bit isn't needed, killing the balance pid also won't do anything, just > waiting is enough, it'll only exit once the balance is finished. If you > really want to stop the balance you can use I think it's still needed, or the balance process would block the later umount and test fails like Adding debug output of "lsof $SCRATCH_MNT" and "ps aux | grep btrfs" before umount shows it's the balance process is still running and blocks the umount. lsof /mnt/testarea/scratch btrfs 13491 root 3r DIR 0,40 42 256 /mnt/testarea/scratch ps aux | grep btrfs .... root 13491 7.0 0.0 18660 1312 pts/1 D+ 23:29 0:00 /usr/sbin/btrfs balance start /mnt/testarea/scratch Killing the balance pid is to stop any further balance operation, wait is waiting for the child process (_btrfs_stress_balance), not the child's child process (balance process). So only wait is not enough, we should wait for the balance to finish explicitly. This is also true for the rest of the test cases in this series. This is kind of ugly, but I cannot figure out a better solution right now.. Thanks, Eryu Reviewed-by: Josef Bacik --- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- tests/btrfs/059.out 2014-09-26 11:35:43.932850826 +0800 +++ /root/xfstests/results//btrfs/059.out.bad 2014-09-30 23:29:47.538310375 +0800 @@ -1,2 +1,9 @@ QA output created by 059 Silence is golden +umount: /mnt/testarea/scratch: target is busy. + (In some cases useful info about processes that use + the device is found by lsof(8) or fuser(1)) +umount: /mnt/testarea/scratch: target is busy. + (In some cases useful info about processes that use + the device is found by lsof(8) or fuser(1)) +_check_btrfs_filesystem: filesystem on /dev/mapper/rhel_hp--dl388eg8--01-testlv2 is inconsistent (see /root/xfstests/results//btrfs/059.full)