From patchwork Wed Apr 19 14:09: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: 13216883 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 C37D1C77B7F for ; Wed, 19 Apr 2023 14:10:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D07D090000B; Wed, 19 Apr 2023 10:10:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C92F7900007; Wed, 19 Apr 2023 10:10:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ABBBB90000B; Wed, 19 Apr 2023 10:10:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 97B2E900007 for ; Wed, 19 Apr 2023 10:10:52 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 2FB47C02AF for ; Wed, 19 Apr 2023 14:10:52 +0000 (UTC) X-FDA: 80698326744.12.F71BFAF Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by imf19.hostedemail.com (Postfix) with ESMTP id 60E8E1A001B for ; Wed, 19 Apr 2023 14:10:50 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf19.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.46 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681913450; 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; bh=D58hy5/Cr3/DLqz8bPLF+cijdU1EeyUsaB6+w7+K1A4=; b=lRapsg9ZCdNToltvIb3vlRpCA5KQlkVH622xmh4M8qJqlxlBeXkwhuyc/II4NBnUZHSIHZ Or/OjwGLPWWdKy7sjkjzaWjMY88ONqWbDNzcI3P7R+9ryQ9fa+VQEYilqpl4iwyW8By+Uh y4FRyQh9VDhQ5+GmfXC6uAPpDlLzFek= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf19.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.46 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681913450; a=rsa-sha256; cv=none; b=KI9bCZ/puQckSO6WXiC1sgcpMHM9yz72APgOSKTQ5ta+ncvtn8UnaoFiHgg5VhlqZioUZt 854KyU+Ym6ekc31nFS5stmtOUBjvwfnfzVHjuxrkSCuk6AxeoIgpfnfBVc36912g1KpnIj nxd/UkV0gqEgbKYI08L2PxkyORzIXmQ= Received: by mail-wm1-f46.google.com with SMTP id v3so4151997wml.0 for ; Wed, 19 Apr 2023 07:10:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681913449; x=1684505449; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=D58hy5/Cr3/DLqz8bPLF+cijdU1EeyUsaB6+w7+K1A4=; b=KyZFjft5IgW7GpZ1Z+0LQP7QI5gYa8ptCzWHBLCjyBJnfIeAwIex3lMSlDUc6SrEx2 YFja9yhiCpgS0SVSczkt8v7VLIjUNlWxxQwzT6/NeqIh5CJ5zPmA1EBL0bjAd8eiWwcU 9uto8rtZ+iF1SzPWHWH+WgC8PG9qRVZa2OoaHFrC/LXlx/avf32aY2QiQjOSXeRntfYR DVXEQN0gBH12eRD9ZJjkS+24ZgOgBNlvFp/HSHCRxFTjEIxO4lX7eR7BMaOz0IPW6Ugf Bcd0mowVvPxs25XL3hfLQ7qbVYRC5gNQHpk7EJyxvurqvQWfhCHQDMdnZEeQBcnrdWup +fVg== X-Gm-Message-State: AAQBX9eSIVgoWb0tYrmDyboDIc4PepDhmNwKONkgatUFbFHwV+m2P7WJ hXyMofpPVxNHN4f3gXmeNR0= X-Google-Smtp-Source: AKy350YVGom4jRqLlz1SlZT1B3VxAH80TCdfTvTrIcrTBS48HRxL8jnx3ehntNMClr8C3qNVzqHCog== X-Received: by 2002:a05:600c:24d:b0:3f0:373d:780 with SMTP id 13-20020a05600c024d00b003f0373d0780mr16769739wmj.34.1681913448956; Wed, 19 Apr 2023 07:10:48 -0700 (PDT) Received: from localhost.localdomain (aftr-62-216-205-204.dynamic.mnet-online.de. [62.216.205.204]) by smtp.googlemail.com with ESMTPSA id q17-20020a5d61d1000000b002faaa9a1721sm7612089wrv.58.2023.04.19.07.10.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 07:10:48 -0700 (PDT) From: Johannes Thumshirn To: axboe@kernel.dk Cc: johannes.thumshirn@wdc.com, agruenba@redhat.com, cluster-devel@redhat.com, damien.lemoal@wdc.com, dm-devel@redhat.com, dsterba@suse.com, hare@suse.de, hch@lst.de, jfs-discussion@lists.sourceforge.net, kch@nvidia.com, linux-block@vger.kernel.org, linux-btrfs@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, Damien Le Moal Subject: [PATCH v3 13/19] zram: use __bio_add_page for adding single page to bio Date: Wed, 19 Apr 2023 16:09:23 +0200 Message-Id: <20230419140929.5924-14-jth@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230419140929.5924-1-jth@kernel.org> References: <20230419140929.5924-1-jth@kernel.org> MIME-Version: 1.0 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 60E8E1A001B X-Rspam-User: X-Stat-Signature: kubytf3bptabezo1bee78ne9fbjsfhbx X-HE-Tag: 1681913450-80085 X-HE-Meta: U2FsdGVkX19r7fRKqWfovaBsK7LZ2+in4e1i/WlQtNO+r/ECvizCwUmCa5zNtDkuioxjW7UI3It406shpC8IJLa0inqA+5NVkrO5QFudGXB9+IZsjoEiJ5GJxEQzQ0T4jNwNJi9MC/Bffhej6DC/AVA9fsATI5JynMeqll2PbGyeJI07ey2WHmCjfJKyg8dZILbB/Ms07m85aYhyl/qcrL/BdwuxEumpHuzRi6uvch+q23rMdZzZBxu4v5vR4p1tkd1JqnhGNMmrYtCjlG6sJDyLH5t/a+Nss2egxkrRqWSMh5Hu3B6ufk02MiP4BLilyAbwP2Wm8rML3xTJ5VWDXWYS9uGzQZ+7rOXNHoithvpWGqgagL3K951a+SBJlqGFysVHPD4YmD12ju9cnQcFIotehONtWw7MkXkBlgvZijENn9R0hvdX5TlaLfD+MoP/OFgg84EY76BeMnb9kcSEn3CHfiHCouE6yPgTZNZOwr+0sxU/3D05M5+e/u5hdI34Mab4L6QKTF2NRGmXEq1VbRL7jOMoNlu7cP+QkfmHpn0VkZu13fZe0RGEMhDT6vpQZwkgCJhrNWb34gWnbtzLv4ilRYyRhpTS26DYUNCtFnW6i0M+FrRKaBWqtPCOKREWmghCUyrByMOPzvdApAnYeagYoMOFrRYGweyQD/2b2/fWEdLsi9GzyD6o24sWLxo4bFf9Q0S/2mieiUezxHWduuNrR/ksJMdFSnSt+OcKklKrmriV3t8yxBVWsydhiO4TirMxZclVb6j/KNph3wz7BfvwZCF5cBfUQAO7UXW8BO90CRPA8KYdyWMaxhifoisB0QmXy1ATganfNYm5GrscQEGwz3Ki5EGuE6r3sIdvjzFmbJdHh6AbY3CuhDvyL7gtn5db7Ts3slx3H+7ZCSusPXfn1xu+7d82Hs6pFFcBuxYGNAXtudaP/RZt9IzhB4TymU0Jy28x+fksyZYs6Al WxrvP0W2 l0Y49nCWZqGjokuk5Oif+bGTz5L18mLbKU3TAjmIWbYHoM3jufDE8ustkzQRl45o7gE2NfxmyMgfqhLOZ+zNbEpPG6AJAYrDNkPWbaII7M+bg1xz+MkwRNpGIRgsiu8BzsvP+35DvUjlqi77fKqRlhj3tNGerflmFmmKtFFWwA3l2WNzBIWI39cMrI+xdOQ44IqVSBLJSuEwpDX175UMXTFQer7qxDK5815aXv/GUladzqLLmf2B/X7dru7BNO769f/FSd3zhsSg0l8t7L4PhHBTx1o6/dLHuhPtUqtF8nX4LAG1z7hS3+5jFczxK9R0OZGtaW/q0i97jrzl/C68Y1ajfg1q4cC8l1BBD2Q2Z5AA9vFgk9QBUkcEuSkAGLRJB+cOHkgbEdkfPtb/YBXw8WwKeFBEiNK7WqW60yGEGLe/841P4Q9/COYcVw1URNH6ZVuhbcBohdcMb99p0tP4dUzKqi5Mv/iX4Tl1N+V28s7UX8H5l/fn+vV+aGBDFfXWybm1MJVSAX4tNBRCNr0hYjzn9UGyqHjSxRt7RtSkbtKn73iDvq2nCgxHAAVnsECpoAXQ0cM8tD6/ewQLoImEBAI26VcC2N5EKjpjH 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: From: Johannes Thumshirn 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 --- 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