From patchwork Thu Aug 20 14:28:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eryu Guan X-Patchwork-Id: 7044781 Return-Path: X-Original-To: patchwork-fstests@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 68EAF9F372 for ; Thu, 20 Aug 2015 14:28:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 90EFA2058E for ; Thu, 20 Aug 2015 14:28:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 89B10205AA for ; Thu, 20 Aug 2015 14:28:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752723AbbHTO2g (ORCPT ); Thu, 20 Aug 2015 10:28:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60670 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752724AbbHTO2f (ORCPT ); Thu, 20 Aug 2015 10:28:35 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id DFD9A8CF56; Thu, 20 Aug 2015 14:28:34 +0000 (UTC) Received: from localhost (dhcp12-142.nay.redhat.com [10.66.12.142] (may be forged)) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t7KESW6Y030439; Thu, 20 Aug 2015 10:28:32 -0400 From: Eryu Guan To: fstests@vger.kernel.org Cc: tytso@mit.edu, Eryu Guan Subject: [PATCH] ext4/305: reduce runtime by limiting mount/umount cycles Date: Thu, 20 Aug 2015 22:28:27 +0800 Message-Id: <1440080907-25163-1-git-send-email-eguan@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Spam-Status: No, score=-7.5 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 ext4/305 sleeps 3 minutes and does mount/umount loop in background, which produces lots of logs in dmesg and 3 minutes is not necessary. Ted pointed out that 30 mount/umount cycles is enough to crash a buggy kernel, so just limit the mount/umount loop to reduce the runtime. And now the runtime is about 2s. Reported-by: Theodore Ts'o Suggested-by: Dave Chinner Signed-off-by: Eryu Guan --- tests/ext4/305 | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/tests/ext4/305 b/tests/ext4/305 index 860d0a6..1711aae 100755 --- a/tests/ext4/305 +++ b/tests/ext4/305 @@ -53,19 +53,18 @@ DEV_BASENAME=$(_short_dev $SCRATCH_DEV) echo "Start test on device $SCRATCH_DEV, basename $DEV_BASENAME" >$seqres.full _scratch_mkfs >>$seqres.full 2>&1 -while true;do - mount $SCRATCH_DEV $SCRATCH_MNT - umount $SCRATCH_DEV -done & -PIDS=$! - -while true;do +while true; do cat /proc/fs/ext4/$DEV_BASENAME/mb_groups > /dev/null 2>&1 done & -PIDS="$PIDS $!" +PIDS=$! -# sleep for 180s, in most cases a buggy kernel could hit BUG_ON within 3 minutes -sleep 180 +# 30 loops is enough to crash a buggy kernel +i=0 +while [ $i -lt 30 ]; do + mount $SCRATCH_DEV $SCRATCH_MNT + umount $SCRATCH_DEV + let i=i+1 +done # no BUG_ON, all done kill $PIDS >/dev/null 2>&1