From patchwork Wed May 31 11:50:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13262050 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 3D3C4C77B7C for ; Wed, 31 May 2023 11:51:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D253B6B009A; Wed, 31 May 2023 07:51:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CD75F6B009B; Wed, 31 May 2023 07:51:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B76E06B009C; Wed, 31 May 2023 07:51:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id A64386B009A for ; Wed, 31 May 2023 07:51:31 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 7F3D1160390 for ; Wed, 31 May 2023 11:51:31 +0000 (UTC) X-FDA: 80850385182.15.24016C9 Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by imf10.hostedemail.com (Postfix) with ESMTP id 505F4C001B for ; Wed, 31 May 2023 11:51:29 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=lbMSW3Vy; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf10.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=1685533889; 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=vBhERJyH7iZFJP2+DBlNzG4J3OKG3vOoXxHtp7iVZXs=; b=PTTqcQUOhhNE3IfKpI4W+w0VchJWqvOPaM3VONlIxlcfHA0Zp5vaC2EjodATWNZaM/uStM t8UOVaSrMllH2ArU3QUV+E3zW5HY8Y0hz8bpZ9BY9Ayuk5l0hDNQdomUvR945RxGa/WwH2 1tPsqlJpIYrl1ILo6ghD90dY4h25N/Y= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=lbMSW3Vy; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf10.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=1685533889; a=rsa-sha256; cv=none; b=JDoaN7046LcMgeBoEjhAyOZ1kcw4rgNiWkI+aD7CH2jVW+zHKZTW+cA6mhKBP0cwzUydDp gczW5+hNRX9qpF8o8LVXB/ZZuv1xE0vkFYfcD7sUuknkApo7Q6diD6FIcGBrGBwmIGm6Y4 zp/lCFdHvQBctOIf5XKMKTddZPzGojA= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685533889; x=1717069889; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Hm9sz+6gQ1vQAlShNXkzg+WL0o4VgpWyUzccJnRSUVY=; b=lbMSW3Vyv4tyEWq/7dSFD1bZLdcouxxx7F/jpHbzBbU6Y/nJGlyI7XYq /WvhDa2X8RyDe1HQmGrcK4VWwi3+xMlyyQhlx9e0EzGNx1Xu0mxObjlTB TDvUHr9SuRz1eIcr4dxh+tCV9WqXqK2nBMN22sA9kNHoQ4mZcm3J62ylF SDQYLtqyeUy3VMfW5mPwBlrEQ8ERMCvgm2e3J3NWqzfsyYb3sTeN8BxSg wfR5M1mhJjrH23q/hgW+8X8bHT5RtxDj9ZwhZAz5u+GLW7jEJYmWifGZn Dm0hjzQM7PzQs3k3YCS0AsGjlRSycyDmnjHcvLNm1POOfbw1fbiWnB1lS w==; X-IronPort-AV: E=Sophos;i="6.00,207,1681142400"; d="scan'208";a="230207459" 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:28 +0800 IronPort-SDR: zQeFMzA57G8Tjw6snFJB2HAiifXayjgPRsSx11EuHMfNcwdsLPLLufMcY1LSVuEW/UUNPErFIL L2qRJ7Z4OrORyeEFK1fKYXuz4mFfp/ekhvBjlQzz2in8Hro6zaQBmBooD7hvJ2jq2VooxMZ6bG nIE6VPvEJYjgivWh0YCdwagNSwqAZCLcf0iuU8/Tr2/Gi+td5Lvs1OvFsDwSSir4M5fvwMv297 CQEH8t/L2nvApRjO0xkYeRqoj/KUH5OyMPqG3lY+WJEcBpM9dHol1zSi5Me7MqQz1QFWYsfyHH RQY= 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:21 -0700 IronPort-SDR: ZZvgdXqWvf2bLPrnAzdu5RRz15ga0Chi9bLZvedEHwiFH+B9pi1FcckdZ9/wvgZDFhJZaVL+Gb BhT3tjRKwgxHLeMEuSyllM/qJbuncE8qbGgRTt2n/CBlkxPhKUal5Omdh78LULTg56zSv1r4Xu EaLt4CaJU4Rb1gJ2dDbb7DbwFFDTwtL1QrA2IPFcyQpyOtCc2SCv82C+Ozex//EzTenqavOpi1 mtt/lwX3ifWVjnHHZE9zO0efKjQ4U5fS3Sv/0Tpv49OzM2Qr9C8+dRTcsbUdyAftaM3SElFTbV W6o= 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:26 -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 12/20] floppy: use __bio_add_page for adding single page to bio Date: Wed, 31 May 2023 04:50:35 -0700 Message-Id: <33c445a3b431270c72d9be03d5da1b08ae983920.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: 505F4C001B X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: phzdoxdts99m1ep4o3rxmnis831136zu X-HE-Tag: 1685533889-784873 X-HE-Meta: U2FsdGVkX1+NpudeIItYYtrPTS6302bc7p/pF0H0UmhIpCmwyHXfi0T48gY6pvpi5iY3vF/pJ9w9HLsWa0f2GU6D7nRkrDjpqeBFV3+AU7gUJTVhEEXmOHuwExGhmjcU3qiOpbSmUFGG0VsZ8fRofP4PyIuoOBxk7fjOvh+BHOu8VVB4owW5gwLdYvsRyWeG53PW2g4xJ3QNlkB83XB6hS0LDPjJkD6b2FOdFuihEB4CmqONIHL2vX4eFpXh5Om6fmQUz7r/GPsIs5Dn5s4PEQIyrxJ4KwTKFoqb1CIC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su973N3PI4QpOTHI9vhfrLgOpHRJ9FlWphiQ== 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 floppy 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 Signed-off-by: Johannes Thumshirn --- drivers/block/floppy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index cec2c20f5e59..28ec6b442e9c 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -4147,7 +4147,7 @@ static int __floppy_read_block_0(struct block_device *bdev, int drive) cbdata.drive = drive; bio_init(&bio, bdev, &bio_vec, 1, REQ_OP_READ); - bio_add_page(&bio, page, block_size(bdev), 0); + __bio_add_page(&bio, page, block_size(bdev), 0); bio.bi_iter.bi_sector = 0; bio.bi_flags |= (1 << BIO_QUIET);