From patchwork Mon Dec 7 09:23:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Borisov X-Patchwork-Id: 11955189 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9C58C433FE for ; Mon, 7 Dec 2020 09:24:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 785BC22A85 for ; Mon, 7 Dec 2020 09:24:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725787AbgLGJYH (ORCPT ); Mon, 7 Dec 2020 04:24:07 -0500 Received: from mx2.suse.de ([195.135.220.15]:59334 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725550AbgLGJYG (ORCPT ); Mon, 7 Dec 2020 04:24:06 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1607332999; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=EnGQN8Iyp0xc43NKGY1+51ALiduJ+Muvt0s6vL1u/u8=; b=C2yq3lfOy40KSNoTXHEA/yqAXMzk00KErDtjMUHVKbJiOzoIoUdkqQmMybFioipFJK4Mhw pIpXMnx/1gfG1cWWxpkVLTSwtS6PmCxKKRF3uMJsLfyfq9xuddvkTKNhOuoQJXlNMn0EuG WmST/PtTsdU+wApOK5sAVkQfypVcLjc= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id B9985AD79; Mon, 7 Dec 2020 09:23:19 +0000 (UTC) From: Nikolay Borisov To: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org Cc: Nikolay Borisov Subject: [PATCH v2] btrfs: Update btrfs/215 Date: Mon, 7 Dec 2020 11:23:18 +0200 Message-Id: <20201207092318.950548-1-nborisov@suse.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org This patch updates btrfs/215 to work with latest upstream kernel. That's required since commit 324bcf54c449 ("mm: use limited read-ahead to satisfy read") changed readahead logic to always issue a read even if the RA pages are set to 0. This results in 1 extra io being issued so the counts in the test should be incremented by 1. Also use the opportunity to update the commit reference since it's been merged in the upstream kernel. Signed-off-by: Nikolay Borisov --- V2: * Updated comment above buffered read issue command to better describe why 2 failures are expected. tests/btrfs/215 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) -- 2.17.1 diff --git a/tests/btrfs/215 b/tests/btrfs/215 index 4acc288a9f60..748287e74cdf 100755 --- a/tests/btrfs/215 +++ b/tests/btrfs/215 @@ -6,7 +6,7 @@ # # Test that reading corrupted files would correctly increment device status # counters. This is fixed by the following linux kernel commit: -# btrfs: Increment device corruption error in case of checksum error +# 814723e0a55a ("btrfs: increment device corruption error in case of checksum error") # seq=`basename $0` seqres=$RESULT_DIR/$seq @@ -70,19 +70,19 @@ _scratch_mount # disable readahead to avoid skewing the counter echo 0 > /sys/fs/btrfs/$uuid/bdi/read_ahead_kb -# buffered reads whould result in a single error since the read is done -# page by page +# buffered reads whould result in 2 errors since readahead code always submits +# at least 1 page worth of IO and it will be counted as an error as well $XFS_IO_PROG -c "pread -b $filesize 0 $filesize" "$SCRATCH_MNT/foobar" > /dev/null 2>&1 errs=$($BTRFS_UTIL_PROG device stats $SCRATCH_DEV | awk '/corruption_errs/ { print $2 }') -if [ $errs -ne 1 ]; then - _fail "Errors: $errs expected: 1" +if [ $errs -ne 2 ]; then + _fail "Errors: $errs expected: 2" fi # DIO does check every sector $XFS_IO_PROG -d -c "pread -b $filesize 0 $filesize" "$SCRATCH_MNT/foobar" > /dev/null 2>&1 errs=$($BTRFS_UTIL_PROG device stats $SCRATCH_DEV | awk '/corruption_errs/ { print $2 }') -if [ $errs -ne 5 ]; then - _fail "Errors: $errs expected: 1" +if [ $errs -ne 6 ]; then + _fail "Errors: $errs expected: 6" fi # success, all done