From patchwork Wed Apr 19 14:09:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13216881 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 7C71CC77B75 for ; Wed, 19 Apr 2023 14:10:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2F620900009; Wed, 19 Apr 2023 10:10:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 257C9900007; Wed, 19 Apr 2023 10:10:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F2915900009; Wed, 19 Apr 2023 10:10:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id DCC55900007 for ; Wed, 19 Apr 2023 10:10:48 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 802721402B0 for ; Wed, 19 Apr 2023 14:10:48 +0000 (UTC) X-FDA: 80698326576.29.7436025 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by imf06.hostedemail.com (Postfix) with ESMTP id AB15618001C for ; Wed, 19 Apr 2023 14:10:46 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf06.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=1681913446; 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=tjFYGcD8nQN9rifaEDTZAqJ2yu2mzhO8AAh5DrpkTqw=; b=tMSgvDlBKJVrBMwAR/QOxmHNkSGze9V1E6R8fVucoK/PJlYaXjdgDrjXj4PO9/1rAeJ7KF reJbMk4RFMvl0L+N4rcaeTVQdPSsXm7L1/GKJZaI+m37ehBcXY1pT6uV+BtWGE8oRtn29y NorYAXiY0EMrRtwJ6PP8eNOxbOw0BnU= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf06.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=1681913446; a=rsa-sha256; cv=none; b=cNS0CkOdNxjYtCEwHC+wA57oTAphy3ptv1GVKueKukrT6h1J2CEl3c+Ac91fvpQSVMA/Y9 SbOV9fS0qhOGCVbDpQUrherGMfsPaYkfd74DIFLEn7RUQ+EOQUXhEgUPqBd6T7DNfi5nLZ nG0XS+PvJ2evPExFbXWTdX5jRQZZQc8= Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-3f16b99b936so20277525e9.3 for ; Wed, 19 Apr 2023 07:10:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681913445; x=1684505445; 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=tjFYGcD8nQN9rifaEDTZAqJ2yu2mzhO8AAh5DrpkTqw=; b=aCp6kMeXAaIriqUqlpk1T1NajVWfE3J1zSv8fz4opUXaBvM7TprCOwiXGufyX6/OYe V36YtbKlbgycIzxsEI6/0ZM/5twHnyTw0l40ChHX3ksbhCuEvhbokU4KSngEYtz8F2P0 rqIcAwBf2cul5M5hTpb3sigUG5TRKSItYcKVX514jp4AQORMnZSIQcTh83Dp6u7O7zgJ SB03joTz22YcBlgLnaIanMjYd7uIcgyBbn+4o9zp0lus8+P0HMG5oIC4wDSI0S882Q+G xlsmKVgiHxoZnnHCIN9YI6WhVXuJ1lGwtDG7QCMVQeTTr1ghHIRTBbl0bjAEe2kPYKki t+6A== X-Gm-Message-State: AAQBX9dmk4MpkdnufuLTUTqE4vyegYWfgaw/LN8xC7+xsihSfR7fZnGE TsTJksIS0FpL7RiPn5GuUNA= X-Google-Smtp-Source: AKy350aGGEQ7SWmnov97mBi05fDjNbcA0jBUqTYCskx4hlxP5WN71pxTOnLMeDvsnGyrkEzM33OnpA== X-Received: by 2002:adf:fdd1:0:b0:2ef:c0cf:c72b with SMTP id i17-20020adffdd1000000b002efc0cfc72bmr5153952wrs.29.1681913445555; Wed, 19 Apr 2023 07:10:45 -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.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 07:10:44 -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 11/19] gfs: use __bio_add_page for adding single page to bio Date: Wed, 19 Apr 2023 16:09:21 +0200 Message-Id: <20230419140929.5924-12-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-Queue-Id: AB15618001C X-Stat-Signature: dqfjez3dwmspxarpd64fyikzr8d5c37p X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1681913446-967492 X-HE-Meta: U2FsdGVkX1+L1jhGfr6EzAkBWtcjtV5dezjiwfnCT5Xklx4YZ7Tlhx7IKx5qBTmEdIYm+9o6FPaxgEZXUv+S99iXN3FSYWCeCqQ9J7vsStcIYXbPaHttfr177plemfrT/0oUqW3BomrMR0bDRjk9K8MEgCdgTx4aEoZltvuh/kEgLlGHkxQY4o6emxV47qbL0NK4nO8q/dmc7WuhXJ38+kc78ieBAKP23vqKvtWI0EdCpVlZikbzQflY3VPdAZW0gStSUNkvXd3AYK4cmS2Lp8f96UiRaDowrc0trWWT6FZdYmjjd9lpvj9B/Iz7UhthvUBuFDFCfw+8metc/GLMOHe7WAd1Pa38V7lIJhH3nkIA9to8njocUcH9Uc1itXxGX3HQPPCQNrp9/FQKxtazBVJscTlcOEcZCWqiI3AXeGBq62lUxcHWncU5Edyh+Q8GuCT8PgVIVs3WxKcL29XpZKl6exQOoUk03VyaRVqP6XrtusMOSMclFoe+ubS88/FXVquzWTt/EdKaf1/mCLFxjABPtSO4TNUbj14aBSBXD2MyJv8sj2oTxwllDNCcNjDnStsRJ3VgY9iJblfTvBoq4+jWK0CRCzU+85tUx2W11l7OoppbTJ0PcWehqZfW+MqCw6mS2XaQG3hfP5sWUbY8s/lSd2Ki0tDC4wJYM6hD41tOJmSfI1EHtn7MxqZGsvIBiM/Dcdmy2bd8rtx5Jpen7rCfqIH86BsWtjhp29Zc9MS024PlI7s4+6B3d9rPthMxibdSLSo+cvG1HYEKDbHiCJev21h4d1TdMsBka7YlGacq9toxRiSLUabAb1WTp3ZFXEvKKdZsWY69MYP0ro4JxVjKpwUrtJEA6AnIHIp5vBKpa0AF7jSr2gLYHOb73rmXtvgt2t5jy6T8Ixdd47/aa98IuTTjwcee+rZryj+1osFJPzOMiO+eBNCck+5Ul65gqZcPxqmcWnpo6/WA+rh kybYBoGP gJCtxMyfeO0QJdHnFoxgIHe2cUMujZl7mcO2+L1BYlphLhCGu24u6oNRHgofv2lXqQAJrcamDJsFdp5YEYqNyzYzbOy4nzsLOWas+llBuWJ/3Y3wvUrF+JqPTJbK3S/ghwOz0puvsAHu1HXK+K4lALDm506qs4XKv2CxiOW2gURCXRu9dimUtQOj1FX6mwMLQ6r26IVDJpYTDdzh2ThHdDiWXhH4uZJp6qXinXdQnhibMNyB6IaG1Vqd3lHluqI/1GTMT6cY7134CQYBT7vivno81LxBOgC9OqJyKREnofjraWOP5r5wECi9+Sly3yXNVTHb/RYSTyf+cNiTFpVLk/J1g43OomTDDnZjVv3rFhHZ0PtcFWTlntg1/dC5+C0Y8PAPgG+brzAyoV1l9apr6ucLGM8bRpOecpidA1ssoW5Day0M+z29D1GFkaLbR2l7fg1UinGnVBGLfhEGqrdvK9cqJtvBASYS0EolJ0a63FN5+uKOsPlV58IolybWKZV/dre77CTACWpoh9XK8jo7a947K28LaYiOg1qa/B5H3AlZFte+WlrpaGZ8kJxjfio0/YAni9JpbtWhGesoIj6hW4fV8hi3BR/Yj0Ktg 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 GFS superblock reading 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: Andreas Gruenbacher --- fs/gfs2/ops_fstype.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index 6de901c3b89b..e0cd0d43b12f 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c @@ -254,7 +254,7 @@ static int gfs2_read_super(struct gfs2_sbd *sdp, sector_t sector, int silent) bio = bio_alloc(sb->s_bdev, 1, REQ_OP_READ | REQ_META, GFP_NOFS); bio->bi_iter.bi_sector = sector * (sb->s_blocksize >> 9); - bio_add_page(bio, page, PAGE_SIZE, 0); + __bio_add_page(bio, page, PAGE_SIZE, 0); bio->bi_end_io = end_bio_io_page; bio->bi_private = page;