From patchwork Tue Aug 1 16:14:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Bo X-Patchwork-Id: 9875081 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 0E1A260361 for ; Tue, 1 Aug 2017 17:16:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E70BE286F9 for ; Tue, 1 Aug 2017 17:16:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DBF4E28706; Tue, 1 Aug 2017 17:16:20 +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, UNPARSEABLE_RELAY 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 8B76E286F9 for ; Tue, 1 Aug 2017 17:16:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751992AbdHARQS (ORCPT ); Tue, 1 Aug 2017 13:16:18 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:44526 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751928AbdHARPz (ORCPT ); Tue, 1 Aug 2017 13:15:55 -0400 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v71HFs3k012783 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 1 Aug 2017 17:15:54 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id v71HFrSI013971 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 1 Aug 2017 17:15:54 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id v71HFron032265 for ; Tue, 1 Aug 2017 17:15:53 GMT Received: from localhost.us.oracle.com (/10.211.47.181) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 01 Aug 2017 10:15:53 -0700 From: Liu Bo To: linux-btrfs@vger.kernel.org Subject: [PATCH 04/14] Btrfs: raid56: add verbose debug Date: Tue, 1 Aug 2017 10:14:27 -0600 Message-Id: <20170801161439.13426-5-bo.li.liu@oracle.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170801161439.13426-1-bo.li.liu@oracle.com> References: <20170801161439.13426-1-bo.li.liu@oracle.com> X-Source-IP: aserv0022.oracle.com [141.146.126.234] 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 Signed-off-by: Liu Bo --- fs/btrfs/raid56.c | 2 ++ fs/btrfs/volumes.c | 7 ++++++- fs/btrfs/volumes.h | 4 ++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c index 2b91b95..c75766f 100644 --- a/fs/btrfs/raid56.c +++ b/fs/btrfs/raid56.c @@ -2753,7 +2753,9 @@ int btrfs_set_r5log(struct btrfs_fs_info *fs_info, struct btrfs_device *device) cmpxchg(&fs_info->r5log, NULL, log); ASSERT(fs_info->r5log == log); +#ifdef BTRFS_DEBUG_R5LOG trace_printk("r5log: set a r5log in fs_info, alloc_range 0x%llx 0x%llx", log->data_offset, log->data_offset + log->device_size); +#endif return 0; } diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index a17a488..ac64d93 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -4731,8 +4731,13 @@ static int __btrfs_alloc_chunk(struct btrfs_trans_handle *trans, if (!device->in_fs_metadata || device->is_tgtdev_for_dev_replace || - (device->type & BTRFS_DEV_RAID56_LOG)) + (device->type & BTRFS_DEV_RAID56_LOG)) { +#ifdef BTRFS_DEBUG_R5LOG + if (device->type & BTRFS_DEV_RAID56_LOG) + btrfs_info(info, "skip a r5log when alloc chunk\n"); +#endif continue; + } if (device->total_bytes > device->bytes_used) total_avail = device->total_bytes - device->bytes_used; diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h index 60e347a..44cc3fa 100644 --- a/fs/btrfs/volumes.h +++ b/fs/btrfs/volumes.h @@ -26,6 +26,10 @@ extern struct mutex uuid_mutex; +#ifdef CONFIG_BTRFS_DEBUG +#define BTRFS_DEBUG_R5LOG +#endif + #define BTRFS_STRIPE_LEN SZ_64K struct buffer_head;