From patchwork Mon Feb 13 11:21:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Yang X-Patchwork-Id: 9569395 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 5AF25601E7 for ; Mon, 13 Feb 2017 11:24:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4016627D13 for ; Mon, 13 Feb 2017 11:24:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 344FA27F8C; Mon, 13 Feb 2017 11:24:09 +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 CD00A27D13 for ; Mon, 13 Feb 2017 11:24:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752559AbdBMLYH (ORCPT ); Mon, 13 Feb 2017 06:24:07 -0500 Received: from cn.fujitsu.com ([59.151.112.132]:48526 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752408AbdBMLYG (ORCPT ); Mon, 13 Feb 2017 06:24:06 -0500 X-IronPort-AV: E=Sophos;i="5.22,518,1449504000"; d="scan'208";a="15536573" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 13 Feb 2017 19:23:25 +0800 Received: from G08CNEXCHPEKD01.g08.fujitsu.local (unknown [10.167.33.80]) by cn.fujitsu.com (Postfix) with ESMTP id BD80847D8AAF for ; Mon, 13 Feb 2017 19:23:19 +0800 (CST) Received: from localhost.localdomain (10.167.220.62) by G08CNEXCHPEKD01.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 13 Feb 2017 19:23:23 +0800 From: Xiao Yang To: CC: Xiao Yang Subject: [PATCH] shared/005, 7: add check whether debugfs succeeds to set a negative i_size or not Date: Mon, 13 Feb 2017 19:21:50 +0800 Message-ID: <1486984910-4623-1-git-send-email-yangx.jy@cn.fujitsu.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [10.167.220.62] X-yoursite-MailScanner-ID: BD80847D8AAF.AF366 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: yangx.jy@cn.fujitsu.com Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP shared/005 and shared/007 work abnornamlly on RHEL6.8GA and RHEL6.9Beta because debugfs fails to set i_size to -1 or -512 and reports "exceeds field size maximum". When debugfs fails to set a negative i_size, we can skip these cases which don't trigger the kernel bug. Signed-off-by: Xiao Yang --- tests/shared/005 | 7 +++++++ tests/shared/007 | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/tests/shared/005 b/tests/shared/005 index 296de17..37912d6 100755 --- a/tests/shared/005 +++ b/tests/shared/005 @@ -67,6 +67,13 @@ $DEBUGFS_PROG -w -R "sif /a size -1" $SCRATCH_DEV >> $seqres.full 2>&1 echo "Remount, try to append" _scratch_mount + +#check whether debugfs succeeds to set i_size to -1 or not +i_size=$(stat -c "%s" $testdir/a) +if [ $i_size -ne -1 ]; then + _notrun "Could not set i_size to -1 successfully, skip test." +fi + dd if=/dev/zero of=$testdir/a bs=512 count=1 oflag=append conv=notrunc >> $seqres.full 2>&1 || echo "Write did not succeed (ok)." sync diff --git a/tests/shared/007 b/tests/shared/007 index 0729ab8..06055a0 100755 --- a/tests/shared/007 +++ b/tests/shared/007 @@ -69,6 +69,13 @@ $DEBUGFS_PROG -w -R "sif /a size 0xFFFFFFFFFFFFFE00" $SCRATCH_DEV >> $seqres.ful echo "Remount, try to append" _scratch_mount + +#check whether debugfs succeeds to set i_size to -512 or not +i_size=$(stat -c "%s" $testdir/a) +if [ $i_size -ne -512 ]; then + _notrun "Could not set i_size to -512 successfully, skip test." +fi + dd if=/dev/zero of=$testdir/a bs=512 count=1 oflag=direct,append conv=notrunc >> $seqres.full 2>&1 || echo "Write did not succeed (ok)." sync