From patchwork Mon Feb 1 08:52:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naohiro Aota X-Patchwork-Id: 12058389 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=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 BD5ECC433DB for ; Mon, 1 Feb 2021 08:54:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6C01264E36 for ; Mon, 1 Feb 2021 08:54:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232655AbhBAIxX (ORCPT ); Mon, 1 Feb 2021 03:53:23 -0500 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:59326 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232649AbhBAIxW (ORCPT ); Mon, 1 Feb 2021 03:53:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1612169601; x=1643705601; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JH4g8QXC5N+LounA8q1jKJ7hA2hoBw530oLqRpmKiA0=; b=L/1VBoemcJi3qTItO7il8PhEo9dNrzIKTCGm60fTv5QwMrDiKj9zC0eZ yqosYD6ltvig+TBSVMTrZOdHxRReUpL15EzlfeUyg8YDU9yLA7/grnRG4 MQKHUHit9QlIE47a0auf/NB3lB99gjimbR/bCORFU2javcqdnkQstfMF2 kzOEWxy3YiZL/cdbZZdEfPXrUEhrZpghgqMhlqKFRqHoaCoA5JmNhcC0M teOqw/W1aXugNMOR/d5toVTQ5e4iYo00nVdCaVW5cHNpaBNYZUsGJQZXf hWNKPslqv25A4ZANgzx/hSHpMPJ/+X0uuBNGDZjh4f2n0XyxrzDd1+iUK w==; IronPort-SDR: wgUWbMj+I6Zs9jCxydJIk8C1g0GupSDZOSLkuZYWridxyk7qsR8qSAya/FhG3IPyCUP95k3WtN 302NwVjGLswt12oNbPRuVk+HKb09d65+bc0Fsv2VGJYQpKJcNxadvM9JwcQUuU8Mj7nUsHnit8 fYr69jOQB7ee7I3WuUQrKMkvV82hx2OCLZWCpMCu4hCiRTbFNllaTWufogM3YaMek0M23OHdeQ YtLO5FObu/hYT+YEg/NXz0NVLO/mJnsJPS2hPtlAvoPFCq2/dYXyECrFsGnUjmFp95Z6NKPCjv 06I= X-IronPort-AV: E=Sophos;i="5.79,392,1602518400"; d="scan'208";a="158797700" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 01 Feb 2021 16:52:16 +0800 IronPort-SDR: ssyOYXFxRZcgAogUrR2z44LgUdmoXuJuIDXTpVHcD35eI76tQOVOYyzHnJwdOdKZsM/dnXTluK RFKIxKdr1veG8pQGIz9AQ+nI1JIKTHhlVgbaUzEaVatvV7BU7w1hx24tgkhBC2WDqo8rIvnSB5 temZ5V2Io7DFuPTMixojQILyLKLinOKUpIy1G67RHj+A2eSPUFaOpbQxFCU/Dhp9nBuqfeKihf jZ03GB2M2H31L62pt2ql1ObvCb3xnAvOaEoTueoGkiTii8ZQrlyh0LtvOMThDfDoaRuOWNDQlA Vd6YlSyXF/8TVpvk/Z3N6etp Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2021 00:36:26 -0800 IronPort-SDR: 8Rxi08S0tlHq5KwUWWX0xEJR9rnAVTRJdxjJrkp9TfGE57/FOD2AW62XDazX+1GdxCToXjoefO 613zsiTBM8Jwixd1QGH9ACCiNXMYbD9qZ9KRrCFurGCIXIKxQCtyL1/Vd7BCcYMYRA3n/W/toW EC7OzKRNIYS5DQLPcYm/DC5FcA3yIAcgY9UaXnEpJAPRJDruDfF2R/qMnUElRW3iOuFgSztZiS 8x4C4pr6DH0ph9mICPyTjZbEPg5BJPA4xr7RHEQDolVuWa9LJX7iaTjkG0jylGTAvS5MEufJKL /Jk= WDCIronportException: Internal Received: from 7459l3apk6t.hitachigst.global (HELO naota-xeon.wdc.com) ([10.84.71.70]) by uls-op-cesaip01.wdc.com with ESMTP; 01 Feb 2021 00:52:14 -0800 From: Naohiro Aota To: linux-btrfs@vger.kernel.org, David Sterba Cc: Johannes Thumshirn , Julia Lawall , Anand Jain , Josef Bacik , linux-fsdevel@vger.kernel.org, Naohiro Aota , kernel test robot Subject: [PATCH for-next 1/3] btrfs: fix to return bool instead of int Date: Mon, 1 Feb 2021 17:52:02 +0900 Message-Id: <20210201085204.700090-2-naohiro.aota@wdc.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210201085204.700090-1-naohiro.aota@wdc.com> References: <20210201085204.700090-1-naohiro.aota@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org The variable "changed" in dev_extent_hole_check_zoned() is using int (0/1) to track if the hole is changed. Change it to bool to match the definition of the function. Fixes: 69e81c8e2824 ("btrfs: implement zoned chunk allocator") Reported-by: kernel test robot Signed-off-by: Naohiro Aota --- fs/btrfs/volumes.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index fe2ed5f80804..102dc6636833 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -1433,7 +1433,7 @@ static bool dev_extent_hole_check_zoned(struct btrfs_device *device, u64 zone_size = device->zone_info->zone_size; u64 pos; int ret; - int changed = 0; + bool changed = false; ASSERT(IS_ALIGNED(*hole_start, zone_size)); @@ -1444,7 +1444,7 @@ static bool dev_extent_hole_check_zoned(struct btrfs_device *device, if (pos != *hole_start) { *hole_size = *hole_start + *hole_size - pos; *hole_start = pos; - changed = 1; + changed = true; if (*hole_size < num_bytes) break; } @@ -1459,12 +1459,12 @@ static bool dev_extent_hole_check_zoned(struct btrfs_device *device, if (ret == -ERANGE) { *hole_start += *hole_size; *hole_size = 0; - return 1; + return true; } *hole_start += zone_size; *hole_size -= zone_size; - changed = 1; + changed = true; } return changed; From patchwork Mon Feb 1 08:52:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naohiro Aota X-Patchwork-Id: 12058391 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=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 24235C433E6 for ; Mon, 1 Feb 2021 08:54:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C178464E3D for ; Mon, 1 Feb 2021 08:54:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232032AbhBAIyF (ORCPT ); Mon, 1 Feb 2021 03:54:05 -0500 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:59326 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229736AbhBAIyD (ORCPT ); Mon, 1 Feb 2021 03:54:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1612169643; x=1643705643; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rNLPMXJ7FaWzp+mFx4pkiefigAZutewdrtCsPMpvjOY=; b=FNGWFQSQUxUu0S/qw4Bn9nhXfphjIN8O1i1R4qsF6LlqA0drGMJJTaWl ZXnOCqyAcC+Ovxt9aYVics/himwF6B8H4tTo+Sk+IblJXPMmXdWCys0oP 86eOWBR50QXWXmekgFI3AmFe+QAFSeLRnMi/vwD7xOD6yYtssAK17otRh zxkioLAa9ZS9lQDoOw+bR1lHbKvyFM2gqnRQDyzJc3lH6o1A7Pv26GfLz vrjHWt0NHjnm/vrEkeQeubXwuNZ3Uvo+gJBw6dMRQ671/xCjb2y5mv7EV 5Vz4acgjnsYOj9C8E3pkq7ZeqwBuXth7GPZv415FYx+mdapW/7Q+pe1o8 Q==; IronPort-SDR: +8PTDpWKc1GHnuKlzcpH2SDgFCgZUGCrCkcsu6oHTZvs27yiX5CglLExVfzORDFRUCaApffxVM 9RVV7+6qs2kruu3XbwowEdcKSZbA+Lz6s4sbLw5Ue0sonWlSzBjWqtNQB2/r+Y6Lc5CAO+fxTr aESfrKAE1/7IDwnwVpjU1bcN70QMUsUm5QLoZt3TcU/ikrxhDJ0r3zxcXGHffNIs2maFEmNLpx 24xSFmgaXegeGmczFT61Hjj4bt3udy2rGVNiKd2DAIJkod/0iwJugwcmjTguhWunIZRFAGS1qN +IM= X-IronPort-AV: E=Sophos;i="5.79,392,1602518400"; d="scan'208";a="158797704" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 01 Feb 2021 16:52:19 +0800 IronPort-SDR: l11Zv8QbwiXm6h0NhwXBtlyJM1VBxXr1g4a0XL6EZCVWVfAEHn9l/BHI/Tb8RzM+SmrkEbcHQY /KP2BfADOK9Mf+jSHx7LcClJAsbmTMLMCpyEsdJmrDiBeB6JBgB1IeZQytbxEri9aPzEiAFsR6 L+Yffudev/+pPk6Fnxlz3bLUobW7VYHTRQIjpfGygpcD0gh++cfEt9aCmpU8kGT0QY9D8vQKej 76n75D7vCRg4TqofQ3QjJv7hK5B7NgEVM+Tvt2473gXRAVvsp1XJ/Dfz+MiAozB7c0uI4enPci gJmkIYyPGe25GCP5CwLaCYgs Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2021 00:36:30 -0800 IronPort-SDR: poHiwu5gFiofK/tSU57rT0ALWE5XJXInXriy37VsKyXRTJa+VBDtL1Z/PVG5QfO168jeGWD2kw A96CPnSgPJvZCWsW9lBSBiTKkqDfITAKIFgRAby7fuURV1Vo/w6aHEbOgltJ9K7CiSj5jCvTZo fSVZ3hwzcugtU54LDc1Imoh/3roNrq/djTxOJHI1C/CSbFXOFpPlBYFEaZd2hc1Efw7MIRxNPq OtBhr6s0V3MVx7qFf2Xp2/cKLabf6U/A3cNSmNLZTmOu6SO56JgYbw4QnzwbYVPpNDETcxSBiY 500= WDCIronportException: Internal Received: from 7459l3apk6t.hitachigst.global (HELO naota-xeon.wdc.com) ([10.84.71.70]) by uls-op-cesaip01.wdc.com with ESMTP; 01 Feb 2021 00:52:18 -0800 From: Naohiro Aota To: linux-btrfs@vger.kernel.org, David Sterba Cc: Johannes Thumshirn , Julia Lawall , Anand Jain , Josef Bacik , linux-fsdevel@vger.kernel.org, Naohiro Aota , kernel test robot , Julia Lawall Subject: [PATCH for-next 2/3] btrfs: properly unlock log_mutex in error case Date: Mon, 1 Feb 2021 17:52:03 +0900 Message-Id: <20210201085204.700090-3-naohiro.aota@wdc.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210201085204.700090-1-naohiro.aota@wdc.com> References: <20210201085204.700090-1-naohiro.aota@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org We need to unlock log_root_tree->log_mutex in case of an error. Fixes: 122cfba0d2eb ("btrfs: reorder log node allocation") Reported-by: kernel test robot Reported-by: Julia Lawall Signed-off-by: Naohiro Aota --- fs/btrfs/tree-log.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 1dd7e34fe484..ed101420934c 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -3164,6 +3164,7 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans, ret = btrfs_alloc_log_tree_node(trans, log_root_tree); if (ret) { mutex_unlock(&fs_info->tree_log_mutex); + mutex_unlock(&log_root_tree->log_mutex); goto out; } } From patchwork Mon Feb 1 08:52:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naohiro Aota X-Patchwork-Id: 12058393 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=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 D39F6C433DB for ; Mon, 1 Feb 2021 08:54:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7A1BA64E3C for ; Mon, 1 Feb 2021 08:54:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232452AbhBAIyb (ORCPT ); Mon, 1 Feb 2021 03:54:31 -0500 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:59406 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231915AbhBAIy3 (ORCPT ); Mon, 1 Feb 2021 03:54:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1612169668; x=1643705668; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=P7dGYzeLWW4wl8EYqV0toxgCzcdURANZDs1hKBF78b0=; b=U0kxzg4dQk3nyyAEBGGdT/3bc5WbVa37A2c6K4nUeDjGCynjQd9o5gBt W9Fea1ia8hhhv13HUwcgbiI8zupTVMVTWxKaXY63E/OCLGfWr3glQ9B2W SU+CU8D0aapu2a45kM3RABO/WR4H7TrLWBhdxlrArFkq2I6plwmChhd5A kWg2qwIc05V19uO//7fqA1Jh7tSY7Sq/IV9c3Imh9lHXKlPA083B+sGoN Rle5aIfAfRafe6DraNlNVQuJXW3LgAg79bf5NJCnoiORjAVPhNZWDWn9p a357j2qSP9LBDT2elvmJdF32ezluACqnfMIx8JFLcfJ5JrIii+JSNLppx A==; IronPort-SDR: kBP7i78lc9yIUy+dQqLG42RuPt2QMZ3UtsifgqZlJahAabarN2ejTb0omn81BhSzeqz9fM9l7N rWQYj4IumQZFf/x/9fYb3rzvKTp/8VrxVGphLRLFue481hg9A4S0kpc/vAYsLpw/IGiFiokcPF W1xfCqRLebzK3kooxe7lGn0gS30jX2hGuuye7ok3v0U6AOiHcMJnrd9xBfXcr00NhV7CPM28pm p7nV1Xx7P2X5K2jT/A7q6nyY5Dn0aqGow8iqJgI34Vb0DrfaXJnAG1JjT+LWl2XfDvIoVS11Yf /ls= X-IronPort-AV: E=Sophos;i="5.79,392,1602518400"; d="scan'208";a="158797708" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 01 Feb 2021 16:52:23 +0800 IronPort-SDR: bxvQg72kNKDjMKOhHWLOFeKLmqTrpnC5B/qQG+ocslNTlFGBnCQWWby8v6xbq4bUqAVhc5ffHO LJ3Fx4j34tpQem+8s5bkvrC3dxM7TH7lUyOeEK/CLCIzHQt91urjEInwjiLbQrfD8XkNWe5OWv oVOz0A5qVWlWjdopnOvQ9xBn0lc9Xt4hjoCw87VYX1kmE5Uv+844vZeRhem02IW06G6npv4D01 eX5Axx68plIjtoEd+p+Ka254yr7OpLxuL56fy0yNLc0OjaAp5dpC3r0WGp46D/4OuczvsEWmPZ zrWXAoyA4A/08zUt0Jd7/odO Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2021 00:36:34 -0800 IronPort-SDR: 7/8Y5EVz2Hr+tlGAWztCNwWy9+oLVrlOVgQzPbA/GUGvThihy13LqGfdn+F/2r15eZZsQwWtel Pzwew2Qrr0DEmorIw5Dn9Sjer32063yA5ZrQ7afyEZShXzB2ZrjKHQ2T3I0wXQlPMioOuMTh3M I24j2pzc5vPfkVY8OkQl82nf7vz8/xYNY8Fb6ZJxKAZiBdD7NyEup/XJhmIjaoZSNyyYIZ8h4+ sd3ZVwT1Xh4tTLu/BpfkHy/nxxapUIpySz96K1admvSPo8CPubqY0wvJclWgcZBLkH7TWn+Gqm a9s= WDCIronportException: Internal Received: from 7459l3apk6t.hitachigst.global (HELO naota-xeon.wdc.com) ([10.84.71.70]) by uls-op-cesaip01.wdc.com with ESMTP; 01 Feb 2021 00:52:22 -0800 From: Naohiro Aota To: linux-btrfs@vger.kernel.org, David Sterba Cc: Johannes Thumshirn , Julia Lawall , Anand Jain , Josef Bacik , linux-fsdevel@vger.kernel.org, Naohiro Aota Subject: [PATCH for-next 3/3] btrfs: fix a typo in comment Date: Mon, 1 Feb 2021 17:52:04 +0900 Message-Id: <20210201085204.700090-4-naohiro.aota@wdc.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210201085204.700090-1-naohiro.aota@wdc.com> References: <20210201085204.700090-1-naohiro.aota@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Fixes: 9e802babe329 ("btrfs: allow zoned mode on non-zoned block devices") Reported-by: Anand Jain Signed-off-by: Naohiro Aota --- fs/btrfs/zoned.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c index 362df27040ff..746066d2fd3c 100644 --- a/fs/btrfs/zoned.c +++ b/fs/btrfs/zoned.c @@ -490,7 +490,7 @@ int btrfs_check_zoned_mode(struct btrfs_fs_info *fs_info) model = bdev_zoned_model(device->bdev); /* - * A Host-Managed zoned device msut be used as a zoned + * A Host-Managed zoned device must be used as a zoned * device. A Host-Aware zoned device and a non-zoned devices * can be treated as a zoned device, if ZONED flag is * enabled in the superblock.