From patchwork Wed May 31 11:50:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13262049 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 1E845C77B73 for ; Wed, 31 May 2023 11:51:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B29276B0099; Wed, 31 May 2023 07:51:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AD9F66B009A; Wed, 31 May 2023 07:51:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9C8BD6B009B; Wed, 31 May 2023 07:51:28 -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 8ED236B0099 for ; Wed, 31 May 2023 07:51:28 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 692A616039F for ; Wed, 31 May 2023 11:51:28 +0000 (UTC) X-FDA: 80850385056.11.E1A3D94 Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by imf10.hostedemail.com (Postfix) with ESMTP id 482C2C0022 for ; Wed, 31 May 2023 11:51:26 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=VkMHcR0j; 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=1685533886; 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=RgTLQ0ujtVrmH2npoMMVqBnEFnH1HMUaK48y8FQUJdU=; b=E0wKhnD4up5jk7iPsXDRQfJ3tLFDbsabN8yT1tV3sFnX8acYR8Qqvpgna2KabAFl1pAvHr 8gjxQq+Zp6Kt3HnP0KNjmOQoqZDS7IIG8v4TjK0DzYsAK0Zx3eTRSzdKnkDJ4Eiduz4D93 u6vMPoMsNgMk0xAtUIp6yVkS1bcyLhw= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=VkMHcR0j; 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=1685533886; a=rsa-sha256; cv=none; b=7TY7NywKHzdj41FPSExd/k2583HC+ZwGiH5+CWS2deym+3tZVwdrhxrf9/O/ZWlF7wR6s+ YKNW/er4HH8uvMlqdcJ7WzLNFZIiLCgevAolYFM0E214mnkpV5Og0ytnFYuSEiyITcPeTD R6WWDThwuYeqOqvaxjpimDqP2eEBrPI= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685533886; x=1717069886; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KEvuqAniWi8kHi4qA/R0NoUerrluHuejNoQFU/cmxk4=; b=VkMHcR0jJYA/ZXyNtvgD0xJDnmwamvJ7QZlxEUjUsbjWoU5RSSavIH+s iZ+DV1BGhUIduWofTrKMZm8BqNmHkTEV8WYzvZb3pegPAQfJUYIAetgBk 7s2zZ67mkO3WuugwBrVoe/ZgNDECxtrtKPkptgv2WNPjU03PYat1rT/iY IecEjOqBfSWXmeaXZPt+u3dgzCQGP5DlagOopTT0k75o9x1a+4L7A5EFV mxn84PBuG31V0dRKyajE/wGFFABFketMIoOh3muXWUnA9W0hSzPFbDyTq Dv7Iz8nCzlZeFOYSZsVyw5BlFjD9p/1d7cmz1tRj56Z4xHwkZGn8gycM3 A==; X-IronPort-AV: E=Sophos;i="6.00,207,1681142400"; d="scan'208";a="230207451" 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:25 +0800 IronPort-SDR: MJbBIHFuq3reXblpSn1KLrPGcO5o82xTCIaepnpyQjzgcWNRUeCTfGCRAoHvfEhXQeqrKURS53 F+TiWp/PzVTULJPQxt9c6YzHuMms7NpYsbXv3NE2jpaGMOBHU6mwGMgp7AB/+Y1wGuM0fBFZqi dC1nnaIrcmZnvMbnPyKBQe8GUJV8iptVA3a2t+funG4YAIcRdjJ2DqN/ZjVp7tbOWwjFBxHRVa c+5p/o71QXexBWs5/fKX1Y2mGDLRwGG9U15amKvf17mHIIz9IIDxQzQPWk7qc3kdKPTQFFGN1e N44= 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:18 -0700 IronPort-SDR: kmu31oBFaHnnNAJGr+xhYJn5TvPy7FWZ+3bDl/POq5dEGZ6Ww4ILjSxttl5EfKXZDUQcRli+rZ moVYwDDX+fxlfeNlv+Wrfhx9qjjhuINsRqJ7wDqXzpUIu1qfANLUrv5fZXWn+bq6nOyCp9mL+A jd+tV7p/CL7GZwMnIHFGfEi2kh03FzkyIpZKhbWLGSyU/rpV7IQd8BnuVNyYVVF4Clnms4udrr 8axxTzuHHRxPpkFC7dekm4y71BAXSfErGtkIM3AXOE0UhIxp+Ce8ckzsRvifEaDe/YrKNROIOM ZV0= 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:23 -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 , Sergey Senozhatsky Subject: [PATCH v7 11/20] zram: use __bio_add_page for adding single page to bio Date: Wed, 31 May 2023 04:50:34 -0700 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: 482C2C0022 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: wdn9eqthdwnndsu3osy14z8qmdfhj7k6 X-HE-Tag: 1685533886-838568 X-HE-Meta: U2FsdGVkX19/iWOD6+QqMjCqtLIUCb6NSGZJXfcH+XOCn0q5r+Quu74h2XbBKCaqadygNaGAP+fDnwHNkbG01ICC6VYBN2qBbXIeuhZKQfxtIyLNhdFMa9NJUSGY67jUzCpg0g2HtnewIzsGT8uzLkLvZO4L0qAir4ZIQ6zTsnlio+1OK5yozxTHe1otbPCJQ4exbCLna/7PxhvJbl3fzZrMRcwhzqjhIMMcFSX4zA97cJFM8uS18ruhCwguB1HSyLBvgO15ARPCOhJn0AddyVBdaYln4/XVyqF18+5VTe+fbGNEuQvBpUk0fkzcZOCYV4a58dxXkDUCGWhfB/TIkjo61QSIke3Q/qpv2Q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QcJFj8S/wnAYU= 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 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. Reviewed-by: Damien Le Moal Reviewed-by: Sergey Senozhatsky Reviewed-by: Christoph Hellwig Signed-off-by: Johannes Thumshirn --- 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 f6d90f1ba5cf..b86691d2133e 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -700,7 +700,7 @@ static ssize_t writeback_store(struct device *dev, bio_init(&bio, zram->bdev, &bio_vec, 1, REQ_OP_WRITE | REQ_SYNC); bio.bi_iter.bi_sector = blk_idx * (PAGE_SIZE >> 9); - bio_add_page(&bio, page, PAGE_SIZE, 0); + __bio_add_page(&bio, page, PAGE_SIZE, 0); /* * XXX: A single page IO would be inefficient for write