From patchwork Wed May 31 11:50:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13262044 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 415BDC77B73 for ; Wed, 31 May 2023 11:51:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D24CD6B0093; Wed, 31 May 2023 07:51:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CD6656B0095; Wed, 31 May 2023 07:51:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B76F06B0096; Wed, 31 May 2023 07:51:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id AB6EC6B0093 for ; Wed, 31 May 2023 07:51:14 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 7CD2E1A035E for ; Wed, 31 May 2023 11:51:14 +0000 (UTC) X-FDA: 80850384468.03.CBE9E1F Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by imf25.hostedemail.com (Postfix) with ESMTP id 51135A0013 for ; Wed, 31 May 2023 11:51:12 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=SKsqharO; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf25.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685533872; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ZIbu0TX21EDIwOw8wIGcHvfYOz5FfA+fTkIFuK8R5i4=; b=I7cpX5NbqJl6dnsVXze8KDuR0+dU7Ndxx5rVqsHLTs2q1CvgaR5KH2z9uR9lHCkSrjH8po UUrVJYKdsI6NoeHyzpMEpsPNFMU/1SPzWQa24DOtzRmNHYZR1H8WETE3kFp/o3tONP7nqQ pQiOAC0Es/5LFgbMg6/WEvaGz5kez04= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=SKsqharO; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf25.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685533872; a=rsa-sha256; cv=none; b=8l7eUzkMYrgJ4oUMNApApOhD/oj53CAG1PwEiQQJOJs5jUSrpC+uMLJJwTqTom4ogSjShY r3Dw8i+xnqIFhRyA95J7MlruTeVlfk02v9tRZOqa72+Fem2eNXFd0BfCTctJrvPoEwM+6S r2D7S6SCZdbQamI26YLUzJ8FN31AOU0= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685533872; x=1717069872; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KhIiE2PZNX0ldPMtUgXTcFhOjFzcO4m6Vc6He+n9TMM=; b=SKsqharOrVcZMlzPFUe8COpCO4Fe6b5nqb5uV0C2Se/M8ICSSmRhTVv3 z/v343VqT4DCbB5xwCFYEj/WY5h+AXnsUgq/m5ZvDQr0/E/G4YDInApan Vz8q4965n3lq0cY2AxbnLgQDykiLqyixQdBHHSLlahtvEOpASWqnBweyj BXZcjjFr7YnYydK0VaaS2lb3jqhWdPl8KRvecAlbLZrB5w3jgFOOroEJz UrwA+q17EeELgMUGJ7xBfhY/e2xa4+4E4hZfxz2uFS2nvh3acK/byrj3E hLk0/9mDRjLlupVg4aVmoT2DJVTTdgs6UCApSeCSihyyzChbDRYuFneL0 Q==; X-IronPort-AV: E=Sophos;i="6.00,207,1681142400"; d="scan'208";a="230207411" 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; 31 May 2023 19:51:10 +0800 IronPort-SDR: cOhLU13zMob1wU3VrXP+1zNibN1lOZ1RbCTPY+Y2Eeqe0d+MXyjcZG4Y/1cWpKcUj2ZmJ8Y8uJ mwP03Of8ujF3+DBffg6+2DKiNVG9rnTFZZgZm2ySQcyRrtnGURcvTwR2w3OwvqnyJiT0qcFCZ2 73MWthS/uhtDwgQMR5SnyYNe034yUjIBCnVUCwlpP5AzRMU6RCOSgNalBtFTGKnIsiusMeI1uJ U8wY5DFg+ii+seJSk22cOxD3Z+QVaAv4HHvjcTsuBZHauQmKE5pwGmD8UsCkt1nkR93HJTnKrH q6w= 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; 31 May 2023 04:06:03 -0700 IronPort-SDR: f4sky3ehrJxiT/WAHaDyDgGjgkEGaBVQ9Ynqzb+9FpjL0wrWalF1YoF39q6U55+/vA10v+md4S xA+EZ1AAvJbX4CPvXm2q38H3efX7qrlaeAvxzz0OHLkK/u2zsBNbVKWqTmZi71JeCHDpbVB39S aUtkeULE6SgapnBoQdZNAscRSiR6/B2TGee/piMikW+A9bCZVdTSYmVNk+gXPXJSo+BoUGRM1S G6csNNGPboiDcVMzRkpPA8s+7n4Mf/m2BO4bnujYmZkdKcmmY1nC5gkfsQ85PydSyrrQfCFnhg xVI= 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:51:08 -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 v7 06/20] md: raid5-log: use __bio_add_page to add single page Date: Wed, 31 May 2023 04:50:29 -0700 Message-Id: <832a810d6c9e71f88b0a39cb076a8c70e8bcb821.1685532726.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: 51135A0013 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 598m5ri4699ihjke749tg51kqhi6nkz4 X-HE-Tag: 1685533872-354094 X-HE-Meta: U2FsdGVkX1+xAHb6sihJyC41sJkdIs2p91V5pz2dMpD5JievBjlRzYImATRJw9xCi/7NFYR+TRW6Ts9AnxvaFKl6nraYW93bOSGtsTC/9RPq1dkhL2EU3DyBPjIpg4oGLIhm+S8eJIkAFhu07w6f3zstBVueo14qZd67UxMMAQo87H7BHB3dECKxd+d9biUR0lGiUKA/QcN8KhR9OXnE2KdYo0B/1NRjtXVUCy7OUK0ENUzoIFcLXpj4J6h1VBHXqCrAcJJl336jgiXq7XJ0lcl/j62gfoZiK6a3ZMOxTWtKQIW23OooZ+UZxVAb1zOeL+ke2X+YD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QyVmll1Hb9tLXJMqPUi5ts+C9SDzqJJpcA= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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: Christoph Hellwig 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);