From patchwork Sun Nov 3 17:06:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Dryomov X-Patchwork-Id: 3133661 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 20797BEEB2 for ; Sun, 3 Nov 2013 17:07:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3FD4E2031C for ; Sun, 3 Nov 2013 17:07:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CB6E52018E for ; Sun, 3 Nov 2013 17:07:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752619Ab3KCRHT (ORCPT ); Sun, 3 Nov 2013 12:07:19 -0500 Received: from mail-ea0-f170.google.com ([209.85.215.170]:57161 "EHLO mail-ea0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752149Ab3KCRHS (ORCPT ); Sun, 3 Nov 2013 12:07:18 -0500 Received: by mail-ea0-f170.google.com with SMTP id q10so2424581eaj.15 for ; Sun, 03 Nov 2013 09:07:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=zXybm/RLVilWjuxhW7s3rR1wUWmHpepao45Vl9SoTac=; b=qr8TVP3XTreVAL3LA7o54kL7QKkGnFAa/dirNujRzTK6RIYOiqMKVoulYHGq2d79wG uKykttD1MaWLZazXtcLgRWKaEH3U0XNohruE1qPbNYckn7SnB94oouoeUYeJaDwG2kfq vsGJnB14sXphjc1ni2Dy0yuNlLoUTLQPaE3LouQuXHaRMomqJvqWIwzJCGIgQhgxK/Aj JXk9nsty7F9/jep40vGfFQdZ1PEwncrPR7dYt2o/3uuFrKgKdXAu+2IwlPbml+5ltAoL Y1GOI9g+7ijfC2nGUPCSMVoZJmvHUjhhJCWIeUgoL4QqlNcJUZthf0yzybrTrXpfgVxc DBCQ== X-Received: by 10.15.91.3 with SMTP id r3mr14197340eez.4.1383498436926; Sun, 03 Nov 2013 09:07:16 -0800 (PST) Received: from localhost ([109.110.66.69]) by mx.google.com with ESMTPSA id m54sm35559305eex.2.2013.11.03.09.07.15 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 03 Nov 2013 09:07:16 -0800 (PST) From: Ilya Dryomov To: linux-btrfs@vger.kernel.org Cc: Chris Mason , idryomov@gmail.com, Stefan Behrens Subject: [PATCH 1/3] Btrfs: do not inc uncorrectable_errors counter on ro scrubs Date: Sun, 3 Nov 2013 19:06:38 +0200 Message-Id: <1383498400-21009-1-git-send-email-idryomov@gmail.com> X-Mailer: git-send-email 1.7.10.4 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 Currently if we discover an error when scrubbing in ro mode we a) blindly increment the uncorrectable_errors counter, and b) spam the dmesg with the 'unable to fixup (regular) error at ...' message, even though a) we haven't tried to determine if the error is correctable or not, and b) we haven't tried to fixup anything. Fix this. Cc: Stefan Behrens Signed-off-by: Ilya Dryomov --- fs/btrfs/scrub.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index f21e2df..f94b98d 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c @@ -938,8 +938,10 @@ static int scrub_handle_errored_block(struct scrub_block *sblock_to_check) BTRFS_DEV_STAT_CORRUPTION_ERRS); } - if (sctx->readonly && !sctx->is_dev_replace) - goto did_not_correct_error; + if (sctx->readonly) { + ASSERT(!sctx->is_dev_replace); + goto out; + } if (!is_metadata && !have_csum) { struct scrub_fixup_nodatasum *fixup_nodatasum;