From patchwork Tue May 2 10:19:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13229059 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 854E9C77B7E for ; Tue, 2 May 2023 15:25:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 15F6D6B009A; Tue, 2 May 2023 11:25:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 10FD46B009B; Tue, 2 May 2023 11:25:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F19EB6B009C; Tue, 2 May 2023 11:25:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id E0D516B009A for ; Tue, 2 May 2023 11:25:27 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id E818F140E62 for ; Tue, 2 May 2023 15:15:12 +0000 (UTC) X-FDA: 80745663264.03.485F6A6 Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) by imf19.hostedemail.com (Postfix) with ESMTP id 97E0A1A0041 for ; Tue, 2 May 2023 10:59:07 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=lGxs93O8; spf=pass (imf19.hostedemail.com: domain of "prvs=479dded8d=johannes.thumshirn@wdc.com" designates 68.232.143.124 as permitted sender) smtp.mailfrom="prvs=479dded8d=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1683025149; 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=sMfs9uGDZZcQx8RlHkkvHPT1eKV5wzaFCK+Ux7zjc7o=; b=CmrjEPtZNUfmLMdOGbBxPKh/CAGHl0bAkQTBMHCqHT+KzgX8Ji6R4eXhiQlKLt4vJTzP11 blvD7J7jOVYgERUjPYJufWpI7VOIKMleTDQD3tIMpjlJOwQYwC3VpI+5NJyG+f5oMUkrtU Gh0EcR4Bio60Fxprr4kntZ1UtP7i1LI= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=lGxs93O8; spf=pass (imf19.hostedemail.com: domain of "prvs=479dded8d=johannes.thumshirn@wdc.com" designates 68.232.143.124 as permitted sender) smtp.mailfrom="prvs=479dded8d=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1683025149; a=rsa-sha256; cv=none; b=gUWC3N6IZezJtOcJQNACPXcJmKMf2u5aoO1G9qebTFVyBBC8mkE9Rcyc1kQ/F2Tz7d6IAC vn0Zk73BSGBg6O81OmBKA1OuHDw4EtUA0qcwRizIWondP9EPbzAKMwgCSij4S3l83Te+Fw pcpH63bthbRpq0fYYa88fTEZBGpzj+c= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1683025149; x=1714561149; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=z23s94WSfkNDSGnkvvUzyIU5xJO/4E/eLJVJJaqm43E=; b=lGxs93O8+WmlZeqlMa4mbRez0vNSrNNblWV7VLULoxq8Ls3VOQSZetBt 1kVlnOefvyf6rbpcq5qz6jhTapKxA9QXq328S8wJ5oA2zbYzDbprlO1RI Xp6iLrfgkeosFtEiA1BxXdwPdMY8bvQmO7f7aGFdHHyBLw17ikZxiNV1b gM5cvBngb+WdzqgwnkfETzDV8Dvho8sa2hYsXjnzI+HwZONlkQEwT4hdg oIvYAKJVe1fJMPxJ+DQq/hKB1gKjyHPCsI9qHbFfvVbkzlI5U0dh+3kZP U9HuYH1KTvt52AyuQ6h1Z3NUZpOyHJMc55t2JNtZ1mshYF/BkMeUBk0T0 g==; X-IronPort-AV: E=Sophos;i="5.99,243,1677513600"; d="scan'208";a="334136187" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 02 May 2023 18:21:17 +0800 IronPort-SDR: k/txlx6JPpS4t2BeDQSQJWZZuG/MtGfo0soKKJz+8Asz45W0kn8qyCAWRIcaRviV6zyyKcQd7B KoFZLL1xhJR5IzsGo9mbSis+7JLiFepEG0KNw7rfz4I7JUjcPYlxWcVLlhcys8Bwlc+AwSskSR RW8rWufOp5wjlkIBb4coCeiU/d1jLJmm3Qa45Seb91Iu6jIgLj1Rra/c71foXklmi0SxH+kYq7 dk5TnFARfHqx4EL0glCPZ2INTzRWhrrS8lsNi0t8gt+AGk7lq+YPxz1+CjtUtw1tzeGR9am43n JLs= 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; 02 May 2023 02:31:03 -0700 IronPort-SDR: 4QS0kxeAR11TAsjK3q6rHbu4+NZzJ/T6AbVXb55vKDbMM+oCblWAbUFs2YUG9KGIgOHq6CvJL6 XUwNm6KOwnm57J4RnjJo/YsJf7KQxoqDGhV11a0uPsyKLzme4AtvTwC+ST9Bmtyv86ntqEq4hc s99tUUKJH1Y54xjx3kIzWz1UZPM/tbIrLj/KWTho9Mx5xM2253HnCZK5jP5kww+0Kbc2uMt5Et jTuZjzyn9MCje8+jDXXIghxbJZq3kwbYIlwQW8gMVAhOzG05xOEF+r5ej7Dqx979eenILJzMIN mEY= WDCIronportException: Internal Received: from myd008205.ad.shared (HELO localhost.localdomain) ([10.225.1.100]) by uls-op-cesaip02.wdc.com with ESMTP; 02 May 2023 03:21:13 -0700 From: Johannes Thumshirn To: "axboe @ kernel . dk" Cc: agruenba@redhat.com, cluster-devel@redhat.com, damien.lemoal@wdc.com, dm-devel@redhat.com, hare@suse.de, hch@lst.de, jfs-discussion@lists.sourceforge.net, kch@nvidia.com, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-raid@vger.kernel.org, ming.lei@redhat.com, rpeterso@redhat.com, shaggy@kernel.org, snitzer@kernel.org, song@kernel.org, willy@infradead.org, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v5 09/20] gfs2: use __bio_add_page for adding single page to bio Date: Tue, 2 May 2023 12:19:23 +0200 Message-Id: <20230502101934.24901-10-johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230502101934.24901-1-johannes.thumshirn@wdc.com> References: <20230502101934.24901-1-johannes.thumshirn@wdc.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 97E0A1A0041 X-Stat-Signature: y6duhxwnqmp6qr6tanjhf19xp67a7iaj X-HE-Tag: 1683025147-247056 X-HE-Meta: U2FsdGVkX19FhSXuRvrMBJ8M+qudcY5yOUIW52ZoBThVSTwbnxkwqVVDyaxPvG1iNpMZcSYGl9aj83gnzMDSVE0XP1olHOlRSWTH5ITSM2YaiWwgBLU/Fq7whT0Gdatt72UEKKUQ4nA0QvJUhn2Y6JzZWPo9e/B/YNpiILiwT5ZiSQjtOlh3/uKVeOmvg62U7h/9/YThJ309idK3btCg1joPMFybYMsPGhIFZFNisVxiocbikVuXyGT2pZgi2HcdVrJuJ4TCQk4ifDp7Pcx43PwsDE6alHRnMvevclR1/lgij86Iott4ho/1VXWtBCm4sRUkiyIkWO42TcrfOdIBaFD76Kb44L4k5SnfhBFDPtNe5RdBcmOl36FBDvBq1tMomlg6t8TAz7cxStiAWGA9YHUcPfnupmeNMuCvQM8hxAWHKKDum9DnvjsRsPQ4f+XLZdwL/MWFnI9aN8fJ4wPcWriXhAMg2Zd27u7giI3i51OLaKWgHwW0VlM5W8ubFU7JYBpA3/oWbe3KrsPkgf4RJB0ITi5FJiJCm5MQv77+VyxvvA8FxdhRZW5MftK762zVf+zw6Nr+19uCXooTSkksoG4CyafprlzIYSX8lTZDNSKBUHroUy9KF6i9FvUnA3tnfPghbJjsAL7FndrHkkLd9Nv97Uebc9qV4GWCExnEC4fsONNihNYeRRCYW+V629VZa2a4jnWVEmdRKw6jU4QPeCUswkgp7d6OdmwEeSvi+ju6j61E4i6LR5w4fKnn5l1P7b279RavbhqJ1pPQQIr6ZiKVg99QspwMvAQQCJhRLHhosHdrc373rRsIRct26tLxW/y9E15niMBw5AeR/QLATXzGmB9CItUjYoC7mWuAvOiwEhT3klb/mPvBpur9HFCfay2H1+m6AL4C0BTD0KUEIPGZhm/6W9fJ7kvITTt0R30PZOoSl9XfxdZXrMlXMZgA/+VIIVYfG10cdwOoUov 6w52g6BI cu5m/MAu3oVhJ3JTn+O5PdDNWfjlq+doUqwKWwyM3m8ITgh5VIGA7OMo8z0vNaE6pV3/O4Bdzr0BmANa+t0G3QRc3K8itHXZAmnpw1kOt7Z6qGa6G0KwqHqT6+d0n+WRgvoQdbPz4Z8aoQfMFsLfMHkriPEiBaZ5wEfMqUtTjxl6aD7aIGLNyemUjXb2Pb/2NbXb2FuZLW9ACwIKVVxW2IrfisiSA25xvTt/l 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 GFS2 superblock reading 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 Reviewed-by: Andreas Gruenbacher Signed-off-by: Johannes Thumshirn --- fs/gfs2/ops_fstype.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index 9af9ddb61ca0..cd962985b058 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c @@ -254,7 +254,7 @@ static int gfs2_read_super(struct gfs2_sbd *sdp, sector_t sector, int silent) bio = bio_alloc(sb->s_bdev, 1, REQ_OP_READ | REQ_META, GFP_NOFS); bio->bi_iter.bi_sector = sector * (sb->s_blocksize >> 9); - bio_add_page(bio, page, PAGE_SIZE, 0); + __bio_add_page(bio, page, PAGE_SIZE, 0); bio->bi_end_io = end_bio_io_page; bio->bi_private = page;