From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3BF2C7EE31 for ; Tue, 30 May 2023 15:50:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232629AbjE3PuG (ORCPT ); Tue, 30 May 2023 11:50:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232642AbjE3Ptt (ORCPT ); Tue, 30 May 2023 11:49:49 -0400 Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1515BF3; Tue, 30 May 2023 08:49:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685461787; x=1716997787; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=mEDf+2bPYBdApkRtQGcrKQLhlyK4U4yv8ooj5C9H9Fo=; b=TCvFg37auzUfYJYqUR08KFP+CPl2XsN+KVNi1whiCZF0xiQLL4fyk0yz YuRiRjgZtDw6hpU6FDiO8X1y7f/1ZtaDkqSy1Iid9cndFlP9jtlKYatDN pr5YWLL1PN5+Sl9FlC5fgINNoiHGvDKR2Dpr9tFog6tlaLCHocMvHkfG5 bj+7m6ZpSSr14fGhLgfJUdZx1+zC7YP4a57ApnkMAqAvpztI/NhJD/c25 d4n8F9HUYYFF74jFNzX4UwneaEtb3vNoq+EpS9+RJkBqxSAKQT+cpjdqh ijpTFewuXt/tBiTFfzsIFOk3ZV72tg7LZrzpI7MAxTe54ClGgqhuv5Kzj A==; X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="230129763" 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; 30 May 2023 23:49:47 +0800 IronPort-SDR: CyKAjtx9prE0otV5oEGwfTZ2/YWYr3f3YoVSwcQB51kwuContYTjJK1r1I74YgI/In+9G7rmem kDyscRgh86tLL6hQmZSNUl/OIe3A60CD5pfBBhwrLjxjfUjcJM6ja/IECavpXbC/TAjSaOrqSA SYf1bvWztkZe/O0zcwmQ0sPvTwB7e1SFNVJNF44WFslpZGv38bW24LoBL2Z/IWm42YVXDkCL3L waqMcmzswxrvaXcZ29y10izVMPZ58GjqNa2VhOEfTGPdVIOoLUJbI7kJaMKSolGRW9hxiZd9gz Thw= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 08:04:41 -0700 IronPort-SDR: MKlOX/uF8wNEct5950xnnV315MLl9jdeWlyzj552Na9mJDZsmp05yot7aD76Oi4Xbupl3BrWor CH08la1ldQbZ9LbsD2PbKhD1eEz/Wv7IO4J88KwTSohJz4Tcq8kYJ5TJv5OIor4ThvImZ+P9EU dnuo5e3IdJkZtM6PymLdROP06o8OObtizuI8cob1Ebk7RJhUIOuDEY5ObLtCjGKqVpe5/yRxRA o0I5mrkdFpgizKWYnBAUJNxt+kr6dHKCyqjCW1az0geORLLKn3tAB7Qv9196t3xurORVn7mWMo rkk= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 30 May 2023 08:49:45 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , Mikulas Patocka , gouhao@uniontech.com, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v6 06/20] md: raid5-log: use __bio_add_page to add single page Date: Tue, 30 May 2023 08:49:09 -0700 Message-Id: <1ee0465c7b2634a4435e65a4d0b06019a73d8389.1685461490.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-raid@vger.kernel.org The raid5 log metadata submission code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Reviewed-by: Damien Le Moal Acked-by: Song Liu Signed-off-by: Johannes Thumshirn --- drivers/md/raid5-cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/raid5-cache.c b/drivers/md/raid5-cache.c index 46182b955aef..852b265c5db4 100644 --- a/drivers/md/raid5-cache.c +++ b/drivers/md/raid5-cache.c @@ -792,7 +792,7 @@ static struct r5l_io_unit *r5l_new_meta(struct r5l_log *log) io->current_bio = r5l_bio_alloc(log); io->current_bio->bi_end_io = r5l_log_endio; io->current_bio->bi_private = io; - bio_add_page(io->current_bio, io->meta_page, PAGE_SIZE, 0); + __bio_add_page(io->current_bio, io->meta_page, PAGE_SIZE, 0); r5_reserve_log_entry(log, io); -- 2.40.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5096C7EE31 for ; Wed, 31 May 2023 11:38:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235471AbjEaLii (ORCPT ); Wed, 31 May 2023 07:38:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235082AbjEaLi3 (ORCPT ); Wed, 31 May 2023 07:38:29 -0400 Received: from esa1.hgst.iphmx.com (esa1.hgst.iphmx.com [68.232.141.245]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C755418F; Wed, 31 May 2023 04:38:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685533105; x=1717069105; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=mEDf+2bPYBdApkRtQGcrKQLhlyK4U4yv8ooj5C9H9Fo=; b=DYzFY3poJU/neZZFQ2+rSVxDjdSkgTWMjTmmgNWzZYLdNwdLP6+EIORn s5Qx5ktORioZsMNQz+RCiIX1olOJpQG61zzqwGzIsrVswxI0S19tLJZwm fG8Vo3DgRnEp54m8Ath+l5gU8j/k+Datvmkdx4bDbZSUTpJUp1hGxUW7+ m11MJwYvrcoytxUkmTyrNokLx9RKQsOgPo6FeOb86UcpHioH3MTdkWpfI IrBfDwWuLesCiQPUZyYPw7/Qezy5nns9nlnuTSD5PnvM0DtV6VBAHwnQI ZT4uOFMKC/5Slu4KEIzv0FS6EnJqp7Mg5g0CPthYM7qPotBtpfrTxFbU5 w==; X-IronPort-AV: E=Sophos;i="6.00,207,1681142400"; d="scan'208";a="344179057" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 31 May 2023 19:38:25 +0800 IronPort-SDR: lj6nRjy/jBWxu0IHPOJvkrfx/LA+9PuA4L9ghTxhpl7yl+Z2Qw5oOJ7L4t3yhMnEi9t0Jeet9z ATp1r8iXcRKxguKRsq2Mr55BM1IwI77bTxFily4Nzlq2WyOkAInLbWQPZZgK3YuCDIuIzLkReX WT0/e4WY+nNq4sJqR/EJexhwjHL8M5e/S3IkGLHb6a38RS0Y2OKGEYbdRnihgqsNDiLnvqK4HD K9afk4KIqfQq32Ff7ewxl2intQImHpq6U40vrij4df94fcz6Kp2OpFKTs001bRosqISKXzRWvy K0g= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 31 May 2023 03:47:37 -0700 IronPort-SDR: aNTVBj/pNYOm8LQW/Ysyt++eETiXP7If4qejTn0fgwq+ZBvvjbFqnWjX4cdzAcsB81x+GtufD5 4CHrk3zAtKxRtt5SrrV2bu+MNhH63gMrYcc4D4gKpDa93KWb6m58gjDK9xoBngjeugS4uWE7z9 NwbSUCGGc2OIi/GQCF/6Y8t55/FhJdhT39gpNtonggVW3HmW/CajaG1O4A2XU5aP3EL6Og0AOz J6wM93B7s7mTIZOtB8dnVwSE7Xkm+VtttBGZJwZi8mxnvp3q64E/M567+71xJT/zY9kw6Ysvqx QD8= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 31 May 2023 04:38:22 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , Mikulas Patocka , gouha7@uniontech.com, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v6 06/20] md: raid5-log: use __bio_add_page to add single page Date: Wed, 31 May 2023 04:37:48 -0700 Message-ID: <1ee0465c7b2634a4435e65a4d0b06019a73d8389.1685461490.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-raid@vger.kernel.org Message-ID: <20230531113748.VhYbKhBKRYZPaU1lI2PYf8LQGUsZRZlHv2lSMnnZqUU@z> The raid5 log metadata submission code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Reviewed-by: Damien Le Moal Acked-by: Song Liu Signed-off-by: Johannes Thumshirn --- drivers/md/raid5-cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/raid5-cache.c b/drivers/md/raid5-cache.c index 46182b955aef..852b265c5db4 100644 --- a/drivers/md/raid5-cache.c +++ b/drivers/md/raid5-cache.c @@ -792,7 +792,7 @@ static struct r5l_io_unit *r5l_new_meta(struct r5l_log *log) io->current_bio = r5l_bio_alloc(log); io->current_bio->bi_end_io = r5l_log_endio; io->current_bio->bi_private = io; - bio_add_page(io->current_bio, io->meta_page, PAGE_SIZE, 0); + __bio_add_page(io->current_bio, io->meta_page, PAGE_SIZE, 0); r5_reserve_log_entry(log, io); -- 2.40.1