From patchwork Thu Jan 17 10:15:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 10767865 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7622D91E for ; Thu, 17 Jan 2019 10:15:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 665032A4CC for ; Thu, 17 Jan 2019 10:15:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5AA0C2BBD7; Thu, 17 Jan 2019 10:15:44 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 068DC2A4CC for ; Thu, 17 Jan 2019 10:15:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727616AbfAQKPn (ORCPT ); Thu, 17 Jan 2019 05:15:43 -0500 Received: from mx2.suse.de ([195.135.220.15]:35988 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726029AbfAQKPm (ORCPT ); Thu, 17 Jan 2019 05:15:42 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 9C8C4AE24 for ; Thu, 17 Jan 2019 10:15:41 +0000 (UTC) From: Qu Wenruo To: linux-btrfs@vger.kernel.org Cc: Nikolay Borisov Subject: [PATCH v2 4/5] btrfs: disk-io: Show the timing of corrupted tree block explicitly Date: Thu, 17 Jan 2019 18:15:27 +0800 Message-Id: <20190117101528.8675-5-wqu@suse.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190117101528.8675-1-wqu@suse.com> References: <20190117101528.8675-1-wqu@suse.com> MIME-Version: 1.0 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Just add one extra line to show when the corruption is detected. Currently only read time detection is possible. Reviewed-by: Nikolay Borisov Signed-off-by: Qu Wenruo --- fs/btrfs/disk-io.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 659bab9de03b..bc2379cb2091 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -652,11 +652,14 @@ static int btree_readpage_end_io_hook(struct btrfs_io_bio *io_bio, */ if (found_level == 0 && btrfs_check_leaf_full(fs_info, eb)) { set_bit(EXTENT_BUFFER_CORRUPT, &eb->bflags); + btrfs_err(fs_info, "read time tree block corruption detected"); ret = -EIO; } - if (found_level > 0 && btrfs_check_node(fs_info, eb)) + if (found_level > 0 && btrfs_check_node(fs_info, eb)) { + btrfs_err(fs_info, "read time tree block corruption detected"); ret = -EIO; + } if (!ret) set_extent_buffer_uptodate(eb);