From patchwork Wed Mar 29 17:05:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13192962 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 43A47C74A5B for ; Wed, 29 Mar 2023 17:07:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D733C280006; Wed, 29 Mar 2023 13:07:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CFC6F280001; Wed, 29 Mar 2023 13:07:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B76E9280006; Wed, 29 Mar 2023 13:07:00 -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 A3138280001 for ; Wed, 29 Mar 2023 13:07:00 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 7F97E1A0606 for ; Wed, 29 Mar 2023 17:07:00 +0000 (UTC) X-FDA: 80622565800.01.1068005 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by imf21.hostedemail.com (Postfix) with ESMTP id 7C0621C002D for ; Wed, 29 Mar 2023 17:06:58 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=XJmPUuOP; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=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=1680109618; 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=tXV1PUgRIrS3GQAiD+TC29vg3vg2nyy1N34usulwziI=; b=boGY28xZh29n8lTFDVOB1G+bSvjJeokLDTbl/FGxTB74HaGai5Th7peSFpKpbiYVzeVONb F6C1+rQqeCtTppSlcgBCA6P2A76h4/cTWae54kDcc3Qu2Mdlcm36OZA6AHCnCYGwVH9QWT moG2hOGIycq3iisYiuTGlKrd8CR6OCk= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=XJmPUuOP; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680109618; a=rsa-sha256; cv=none; b=EmXWH1FkSpVsE/6o/8vwsKBz/FpHec9N7cRKWLVM0ZL5ywsm2DB5jLlQPhgIDdUrGI5zxv hmLwIwiXDJakr4jG4zZ/insO6/5evPs89PZe4bPUhwB6AINh9kysCRFcmQ5yAR+7lxwhNQ NBZ8t+diq4WhbdEdgHwsHSHAYivxzVg= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680109618; x=1711645618; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OE8E56I6ppzvZpWL9ourgo+ma9SYticUs78Dn5RisJY=; b=XJmPUuOPabEiOHraauHB1lIOew/tARlVZPAD7+u9RluFUFKq4/6rfmqP LbRX4FohflpRfhX8omU+cZCtizYXGNfWvFsVP/J9235RTBV2p0JARtUCt WGXvedRAWaEYTMCo9v3l/DEFk494rcWiB09wzF5WIqhmr2JBsW9mAP7bL 17lZPELzNQHoJJpc0LuTqnG+P1jvmSwgqEikzIAnYbjTKprP5pCm6m7dC 3M8OCrmnyM+0UF1SG7YsnwU6HsepZWPgflq3cCQ+fyEmlObpjutKlwZsw 59YbjPf8PQg3amRNdzKkzE57ml7jifcva75W9067trH0C2kA6fKtdXYCN Q==; X-IronPort-AV: E=Sophos;i="5.98,301,1673884800"; d="scan'208";a="226807084" 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 Mar 2023 01:06:58 +0800 IronPort-SDR: eh13xZcdQLQ7eLZR+bRZMn6m3Kjo03ZlY2D3XE+OgYy4cQKng366Sjsp79gBqgvvrLifFiwBXr vUKOfRc/iE1bgtOiYC7mYAiR13+wjUMKmcSmb9LwW4mSpgOwy/IcZDho5mm/V4q1gfdK+hj/2b vTkWL2+h9jdLIIv6xhBS0vy+0e0NuJwg9DXXXHp+8urLJVjNioXjg6oIPbNDJ/5QFknhd71Zno C3O/CBMh6jgom1jBW+KbxPfCcKy+xf5Kg5KuEpRwdtSKsMPPZtgDMGnD8Ndm81XYr7t6KUKctX /yw= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 29 Mar 2023 09:23:07 -0700 IronPort-SDR: ciCGYrvEid1OWmTvYsKE9LmMoYXjBdNIDVHp7EEL3ugMQVAD8oiGyKQfXP4pYoV2q7+QBMlQDo 1RsU5Av/PLFMD/vk6LCXNuUcQdAkJoBUKZWl3B3KaNdEDeDAYfT/Xuet1ErBvWVzn4ReZCi6WZ 2tTbl4q+GT70HS8/O6AHUfSoleBf84i/l1JKzfYad7cBsXNtl7QFlQAHRj2CC4pi7SD6n4Katp jEWbuwgpWbRYo0gFrtFVkgDJiiBju+mZl9IO/VVqg+QMlS6vkxNs8qZeLGPjVwt4OicZWkznI4 o+w= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 29 Mar 2023 10:06:57 -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 Subject: [PATCH 13/19] zram: use __bio_add_page for adding single page to bio Date: Wed, 29 Mar 2023 10:05:59 -0700 Message-Id: <339841b3b7ce6b2faf56bcaf9d92e298d878ef64.1680108414.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 7C0621C002D X-Stat-Signature: zqrmu5sf9mgpm4h4b4g1rct8dmp35cog X-Rspam-User: X-HE-Tag: 1680109618-274073 X-HE-Meta: U2FsdGVkX1/dL5BMYrg8zXMG/PB59B/yzvZPgubpMuImfcJV1RL8ZV7r/1TAiVSVidWt6O3v519xrWRqmotX7dlYrEZ6CZKdZ51eSEGFyWDcDREq/Fj0T9+5IEUvt+wcLU/O8QfHfD8+z6DfZo2E3ptJJn3CHPFSTe3Iypa5vAE6280pT+mwUhsTtZH6yD8EcT/adLC9vCinZLFvtMI+7qACEzvBLcu/8U4ffG8OVpblDMnwrfE7v9WWzyhZ/tGLaoLHsjs5Pl8kyBG0a8Z54hXahSWsU/V1GpEJpw66tjb9onehrKdvRo5dQq2t/CQXm6L23HS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ogosity: 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 zram writeback 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 Reviewed-by: Pankaj Raghav --- drivers/block/zram/zram_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index aa490da3cef2..9179bd0f248c 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -760,7 +760,7 @@ static ssize_t writeback_store(struct device *dev, REQ_OP_WRITE | REQ_SYNC); bio.bi_iter.bi_sector = blk_idx * (PAGE_SIZE >> 9); - bio_add_page(&bio, bvec.bv_page, bvec.bv_len, + __bio_add_page(&bio, bvec.bv_page, bvec.bv_len, bvec.bv_offset); /* * XXX: A single page IO would be inefficient for write