From patchwork Tue May 2 10:19:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13228769 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 BAC42C77B73 for ; Tue, 2 May 2023 11:10:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 36AC1900003; Tue, 2 May 2023 07:10:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 31B65900002; Tue, 2 May 2023 07:10:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1E2A1900003; Tue, 2 May 2023 07:10:10 -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 0F329900002 for ; Tue, 2 May 2023 07:10:10 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id E04B1AE0E4 for ; Tue, 2 May 2023 11:09:51 +0000 (UTC) X-FDA: 80745044982.22.CD910E6 Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) by imf19.hostedemail.com (Postfix) with ESMTP id 2A4511A008E for ; Tue, 2 May 2023 10:59:22 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=nvsEUxVp; spf=pass (imf19.hostedemail.com: domain of "prvs=479dded8d=johannes.thumshirn@wdc.com" designates 68.232.143.124 as permitted sender) smtp.mailfrom="prvs=479dded8d=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=1683025165; 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=xI6cyga7qbtZXy/icNZEKJMGvLFWipGc8tNCJkGzHdo=; b=5151/D+Yr4jK0UkFvZGnhh7nwYowB/NVYzJx8FneFwipV1JAZSbpe9OMLiFP6k7iyj60Q3 y+lj5PH5a/KU87d8pmT8ga6YlR0xhVRRaqM3JgS8xwcLAu2qMUnbd1p7Vusq9R4a0rhHvQ V6ZUqVxBZZ3Apd432A88dNIqbRNEHAk= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=nvsEUxVp; spf=pass (imf19.hostedemail.com: domain of "prvs=479dded8d=johannes.thumshirn@wdc.com" designates 68.232.143.124 as permitted sender) smtp.mailfrom="prvs=479dded8d=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1683025165; a=rsa-sha256; cv=none; b=j5JzHPbT3OdmwYkqH7hHz6TEPYt2oIum8BZaOsFW4iB6EV6N1KLGRIccC9KiuS2COGbAxt AMmK8+3qGdIfyH80c6yPAaD8sBgMLJBIPBKjkvE9eagikao9Pudj9kc9bR7ThhECUoCZ9/ C0/3XIxoyGGm6RoekdtjGWpUyKeSLoc= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1683025166; x=1714561166; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=gvTmlyJDrtB3jz8iBa+x9pcB74OLTnG9vUDo5GkRHDI=; b=nvsEUxVp8vXoOawnWJNhSpE9JoXhnaRGW/rjMpy4nhhpG3ZKjtSTT0U+ GP60Shy23MaKH4Pm6S+SdKvenZoka3O07Xp00Y9eREcic3xrjwP+dIvOZ pjnSbMqWsybjm8UlD0hOuGF3rzcUd16l5f6blUcOgAX3LkHEFMFmGvMjA ANqYws+rVuRKQU5FpYs7RztC6Gq+XejGDlPnvDB19wsOHvvR/NjGa3P5O /o/sI4aBRd2U6LSxxP4Dq8vBYAaAvZulE5WwEibVnFBNiw50krzEUb+yL a2vhS/5dAZUq+hmy6O5Wpx10E30dPqa6qXZEyZEhhuT/1tvLLQIxTXFiy Q==; X-IronPort-AV: E=Sophos;i="5.99,243,1677513600"; d="scan'208";a="334136204" 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; 02 May 2023 18:21:26 +0800 IronPort-SDR: CbNYf4XMuHS6te3gHl9QUsNp+EKksKAVdJgRyNHMvFb0Nx1lrrkn0eQcSQevKzD+9eU+xgM+Bl wEJetMKDG4t1aYiPf1/9H1vGis/uZOVdEBN+sz4Ukr8t4al8LsTcLsBS4g2Tny+2Xgg1a3RuDP lcGGIoihs854/upTPZsh7KqUXJjCosWH1kFmeKzjmDfmT3I6irHU1i5i+GZm0zH89/+Yfu1g5q KIKn80RxpSlT4NALIAo+mNopT/O/dgcslYpdVTM4ddRFw+ARaKEeechpZef2KrjUdgXiepSWSG CtM= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 02 May 2023 02:31:14 -0700 IronPort-SDR: wp2VCzSGIEBx+d279yxevBn1+XI3VuKvqj8oLKNceK55K/eOSJmgxWhB2EK2yL9r249YKUNO4M bGeHb0y1gSCYoZWdb1piBrcelHDZIIRDff/B8f6uw2wt+EBKzLtgHpS/if9aysTLwKYYR4CmyK Ut3+BZdj8uHy5barmhyvli41TJGJFb4YMPGI659Z9H7QJ+LTZHxcRB0MAMkzGM2yCWWsIECayM KNaUJNela6Ul6p5EBpXHf43F6gec7o7gG4gWdqANgAE+DXYIfyjuwn3+4ZYonG6bdrIN5mcSTK NIA= WDCIronportException: Internal Received: from myd008205.ad.shared (HELO localhost.localdomain) ([10.225.1.100]) by uls-op-cesaip02.wdc.com with ESMTP; 02 May 2023 03:21:23 -0700 From: Johannes Thumshirn To: "axboe @ kernel . dk" Cc: agruenba@redhat.com, cluster-devel@redhat.com, damien.lemoal@wdc.com, dm-devel@redhat.com, hare@suse.de, hch@lst.de, jfs-discussion@lists.sourceforge.net, kch@nvidia.com, linux-block@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, Johannes Thumshirn , Damien Le Moal , Sergey Senozhatsky Subject: [PATCH v5 11/20] zram: use __bio_add_page for adding single page to bio Date: Tue, 2 May 2023 12:19:25 +0200 Message-Id: <20230502101934.24901-12-johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230502101934.24901-1-johannes.thumshirn@wdc.com> References: <20230502101934.24901-1-johannes.thumshirn@wdc.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 2A4511A008E X-Stat-Signature: znu8b6ua35jszcxod9ynb7cftasyj65y X-HE-Tag: 1683025162-768615 X-HE-Meta: U2FsdGVkX1+CfC806vf0XbgsLEiyLgCwAGUYq//8gg8wqN6ikdCVxUBlBhkbenkD84pnDKHWcAp9IW5ulny/KnC24A5OUpLnyxduwE6AsKWaLUjg8DW8DGarMxKrDG2y/3MIhMMvf53tQ9My5iC3gLs80/YEDckeJ1kY8N6bOX57b6nFpAr8oB9aTLrsTwrD7ZyLFgiPrL5Na0S4Xt68QWifatRrkjRl+WMvTHJTVik/IR1YMYx+uKGfA/IapwpFPGbfjRG1rMcx6EkWkiDVkMBXIgxmG8iW4nG4GCu3fERO4ehf/p9OWpGDie0sGemCp6WRJK1nAuTkE5uHcFnnlI+njfn60zHMoP8ifw8ZHyF638jzedoyKb8tVUJQFxfyTnNUKJO0Seifxv/6ClCJlfYmJCM3jG2+yNtxEAQHNghYA9na+CJE37Mr2fKgBLUIUsdAprNG1dPYL48rumqoSZFv2omr1IoPJrVSbGlrmzjEwyS/Lo0EZJMHLo7ROmI8mwbvm57XK0H1qGwxVk3YKqFRHc7opiNmWgnrxsa0Fk8TarxQEHRvBY8+TErrXT1/vNByqwJlTVHgl18/Wz5QIpv33vkF5ezLzVWJmXwJC9LYqep27RGguCJOgFeaixpiWrG8v2nQiMnzDcdQq/VcKeqivCpbRAIpk1AQlLPC83+66T+nFRgSWF6SCTnjS6r+QnQAsjZK5Fc4zeBq5MNB2DeHixC7ocOAZvnJnqa8RdSDQyCpLR3F2gRUxNqHuk3hSUVNL0gXPWmTv+wxNB19669vjsLvjD0niX/mZ/wo2K9Kvm6XrgFHlZIl02m75BK2vEURigMfRESbExsgPn12QQK78o/hVM8fba+V2vcap+v8jiC4WffBWFeXoyk1//dO+L4LwQJY1jVjemxTcAdWNcqxYyhKrmD9Zc9DYfnVgBHJRBh7cEKL+A04MrWgOSYabUeOu8kPSQLwPNl5PF0 wIlmFpdh uLaKYAjcSEU+5K34oy6qDSHezvd74NhFLR/fGViOVWMcGRUQIcFyA9XLj0UyUkC8nBFMABZtK2ahgwvzUtvkoMmd/NNIz4sor7rG5bUiETHdvTZtWtnUnieg5Uyh9P132IfeHMFzpTBDXcS7NdD05dv7eBWOwx/wWCqe0uEPADHdvekK3bK6USUo06ThNH72ROQdhNWUuAjV35gKoET1khW4F8YEKCI/u03C0 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 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 a84c4268257a..4b9ca6d41b92 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