From patchwork Fri Jul 3 17:15:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: xuw2015@gmail.com X-Patchwork-Id: 6716481 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 739C79F38C for ; Fri, 3 Jul 2015 17:15:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A7363207E6 for ; Fri, 3 Jul 2015 17:15:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B9BF62064B for ; Fri, 3 Jul 2015 17:15:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755269AbbGCRPc (ORCPT ); Fri, 3 Jul 2015 13:15:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40336 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755013AbbGCRPc (ORCPT ); Fri, 3 Jul 2015 13:15:32 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 31F222EBD1B; Fri, 3 Jul 2015 17:15:32 +0000 (UTC) Received: from localhost (dhcp-12-175.nay.redhat.com [10.66.12.175]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t63HFUxI018349; Fri, 3 Jul 2015 13:15:31 -0400 From: xuw2015@gmail.com To: fstests@vger.kernel.org Cc: George Wang Subject: [PATCH] xfs/015: make it more robust Date: Sat, 4 Jul 2015 01:15:27 +0800 Message-Id: <1435943727-6075-1-git-send-email-xuw2015@gmail.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 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, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,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 From: George Wang create_file may run over before growfs, which depends on many reasons. such as the schedule algorithm, the workload of testing machine, etc. we should always make sure the create_file run over after growfs, then we can get the valid result of this test. --- tests/xfs/015 | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tests/xfs/015 b/tests/xfs/015 index 4dbf38a..d9d4446 100755 --- a/tests/xfs/015 +++ b/tests/xfs/015 @@ -43,9 +43,16 @@ create_file() { local dir=$1 local i=0 - - while echo -n >$dir/testfile_$i; do - let i=$i+1 + local in_growfs=false + + # keep run until failed after growfs + while true; do + [ -f $tmp.growfs ] && in_growfs=true + while echo -n >$dir/testfile_$i; do + let i=$i+1 + done + $in_growfs && break + usleep 1000 done } @@ -89,6 +96,9 @@ echo "Fork $nr_worker workers to consume free inodes in background" >>$seqres.fu echo "Grow fs to $((dblocks * 4)) blocks" >>$seqres.full $XFS_GROWFS_PROG -D $((dblocks * 4)) $SCRATCH_MNT >>$seqres.full +# mark xfs_growfs finished to create_file +touch $tmp.growfs + # Wait for background create_file to hit ENOSPC wait