From patchwork Thu Mar 30 10:43:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13193873 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 BDF91C77B60 for ; Thu, 30 Mar 2023 10:44:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6162E6B0072; Thu, 30 Mar 2023 06:44:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5C5986B0074; Thu, 30 Mar 2023 06:44:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 466996B0075; Thu, 30 Mar 2023 06:44:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 3711D6B0072 for ; Thu, 30 Mar 2023 06:44:52 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 12C15806A0 for ; Thu, 30 Mar 2023 10:44:52 +0000 (UTC) X-FDA: 80625231624.16.BD42221 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by imf28.hostedemail.com (Postfix) with ESMTP id DABC5C001F for ; Thu, 30 Mar 2023 10:44:48 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=XqSkglRB; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf28.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=johannes.thumshirn@wdc.com" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680173089; 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=fGRF54MLXE30iUocDfCg50WtLR0P+nrfwKigypL+nw8=; b=Kr1+7M4vzFHH+7RMyFvMXS3SLuRuqNOjI2sqRU5hGsgP7opAZ1ZorK2AX3chzyx5wqUbhb PMKrm0xm57eUj9wtbvKXIWz2wwKQHHywWxS6v+EcMEZRB1lslIOe4HN+dZfdthGlYOOE0/ 24i0Nvx+GJ3kntpSopHfzNuD1qceAyg= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=XqSkglRB; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf28.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=johannes.thumshirn@wdc.com" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680173089; a=rsa-sha256; cv=none; b=hWOefG4W8Yc6BNBk3E8daILXWY8WF/08LvVruuIQyWOoMKKty/TWjol4JvYp2xBg/0aFOV /ifKYj4KltBF6faFvb8zJ8m0qd1kg4sbX3ao7veqlfH0zkPNhmJw1hk6Bnn+ZexnwTTpHz HsVXJSCLWrB6etnzFaHMedFkxzwE0yA= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680173089; x=1711709089; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=b77AEY+fFVaCfrBI9YuTDKawey5CeI/SslH0xXZFoZw=; b=XqSkglRB4nL5dpccuace60OQ18kMjUdAoVJMz103r9HlTsIgjE8DtULz Xk13CMDf/I3SYiqPBseR/94au0p5wF/95EtszOtGC1ezs5pkb86e8mg9q qNrVTMjtlzbHoeojGhQmgjBOqipZoBDoMgU4aV4/3v2rRUWNp2WT0vcNV jPHTSxaJDouQbD9Kkg1P2Uy0yxHCqhKAnonnNb4SFGKKCgRw+GcarMOM/ c5pSlt5CZmhPb3cmRjQXMfd9kY0AS3JvHvTwZq4e9KViz8sNBi1FF3UWr sXryXBqltzpvdVgFwXyOalJbRocwHTgDrhGi5aL39P+TZ2NA0I/mYOdiw w==; X-IronPort-AV: E=Sophos;i="5.98,303,1673884800"; d="scan'208";a="231853958" 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; 30 Mar 2023 18:44:47 +0800 IronPort-SDR: opx777Z3iCqKeEfVbRVd/JVSO97D9xq/T/dHCEwHKjx4QcxfpycaUOEvcHyx0vJgmVTjmATjXb 5H0Y1wxWszLum/Db0cZuenTndhMAY1V/8y3TGvH+x5m2y+xcdb+cubh3o9sW3g2WMjuiBpGT3h ZY5xRcbN0BEEyBXRRxwvg50yuGXGYlKvUwAxFIMlgRFDmlW4UvO+2j/5+4A+x+5B6cjFUpxObT kuTtx9/KH16HmGBA9MgX0JBmqgzqyeo3g3FiZRYR5Xjftrm/KYyLOxEzI113vAEyQhQ7+1hWMo 2uA= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 Mar 2023 02:55:14 -0700 IronPort-SDR: bPTbKVKtlEcHRrx/gshidhFG8cTmJ7BMiKZMBOrx7BvqKjv6JDBLA7DtLgnQ8cD5tBy5QB4Li8 EChWA24CGnvJ2Bor2+MClUrPy+r+I5aXuZR5uVZa+29PcBU56ON0tvsmmOLEdtLGgyfwshq8on uLUa5y4KbY1OsCGTLPOq9tHpy9dt3I1YsfvmNS3+L0GgTwHGeuOWfftTPpLJxuguO4KUD7Csdp y4baPtiMCCJStynBrqY2vXX+RwLmiiCo6Jnox1p4aCnNgMOXQOiTLaht7Zdw65/ETNfesjB+DJ BFM= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 30 Mar 2023 03:44: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 , David Sterba , linux-btrfs@vger.kernel.org, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v2 14/19] floppy: use __bio_add_page for adding single page to bio Date: Thu, 30 Mar 2023 03:43:56 -0700 Message-Id: <35c82b6fbc054342cce6a2084707bf3866813f33.1680172791.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: DABC5C001F X-Stat-Signature: skeb7e43kydf4nsn1j7qx8d48pxmutdp X-HE-Tag: 1680173088-258288 X-HE-Meta: U2FsdGVkX1/zM8LJ7swdi6Cgaf3pwzjhsklpMmKnm3Refpk01BhEj6Or9MH1VDY3ZUTBn70THU4lMWsOa0zUCcE7h5bVuEZniRzhBeD44QFeb4NKhPZdUgwgd4KVXIYOGd4fhITzZmxuX/PtJA9mxJcoRiviXJzGCT9m01yYLS6rnxGQDaW0u4IaR3SmI/MCKqm0LmqpTZV6aQcolXPbr4bxX9Zzm8YD3r19ZcpGgYzZvy2SsBgEF26KgpgpNnWkNz8Uizq1bIA73r7U66k4uuxZK66H713obIzth2bWsWOsfknzk3NZsQCaKjqHKpEGzymc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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. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- 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 487840e3564d..6f46a30f7c36 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);