From patchwork Wed Apr 19 14:09:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13216886 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 02650C77B73 for ; Wed, 19 Apr 2023 14:10:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C061190000E; Wed, 19 Apr 2023 10:10:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B332A900007; Wed, 19 Apr 2023 10:10:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 939EB90000E; Wed, 19 Apr 2023 10:10:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 77B6E900007 for ; Wed, 19 Apr 2023 10:10:58 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 45A2E8023D for ; Wed, 19 Apr 2023 14:10:58 +0000 (UTC) X-FDA: 80698326996.17.AFA8684 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) by imf23.hostedemail.com (Postfix) with ESMTP id 51A2A140023 for ; Wed, 19 Apr 2023 14:10:56 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf23.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.221.41 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=1681913456; 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=6vsuN/DXTgv6nXT8tixf/9v37orpsS/ZRMb3IsbWCsU=; b=7d+WXMv60gvEhEXEQZkfUlhRb2rl/l3zfIJ3GETFNS1f3RJjedRVVtg8et1FIBfkvSDkgh X2OmaMfM9MRBpI7XbOUILmBNIvhkI1OlXqd26j/b+zYxGsigjNw6Fd+EHhzzuJYcG7iMFx PqotTYhv+VFitWbNmyT5BHCG5fL/eQc= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf23.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.221.41 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681913456; a=rsa-sha256; cv=none; b=tQ7FuhkG22/VlwYt/k1UP/mqIHe6sdXj8mPDHUf+yrk+Y+ERLXXLgRnpVs3N7iPfoI4ic8 pctSLGtpbrlNJO2HUkn415XOIw8H9Rv3DLviyDCH7pmv/K4kxHITGvCXZlbLJjU+IwPGZP gLqFVMt4mSNKHSsa1yW72LyGKWk0ZD8= Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-2fe3fb8e2f7so703044f8f.0 for ; Wed, 19 Apr 2023 07:10:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681913455; x=1684505455; 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=6vsuN/DXTgv6nXT8tixf/9v37orpsS/ZRMb3IsbWCsU=; b=ENddoXLv1aexguRl8hXvudT4O9GHqNWbZhwTDeNZZHChqlLx4ViOBpk9V4gVTvLvh9 JMJee+unBX5Rb+G+22wZp+Lu7DXbAnK48UfzM1z6t/GTbkZXDBBma6W6qNZyfZiLoVjS RSaD+t/9UVi2l9vLByu6naPQ1ED/Df4mUNF2BBzXUji5RnGLbkBW/dzkhk8WQZ7+w3df 6d1uSVxGdWhJh/IscNANq32L+WzATJIoTLgcOhGMEIrpjLptP0IIHfHWk0hGEuFk/wm4 FbqLoef7gaYfjQB5JIDB6Fj6tqsI4rZZG5g+VO0N29XVPfP04IK8KeEKegCPHym1q4HA /U6w== X-Gm-Message-State: AAQBX9cIFvXOT4ZMCbm63qfWgrVAqXGx/+D/IikD6iBWJWreirMK3wtd jpG66HYlBgJChdGUUj9NqPA9J4/BLBOJItfk X-Google-Smtp-Source: AKy350ZtqTfiMh/3xTzWhxaqnfC6KE+V7qat1q3S3ZwFV6mDgq1XPDVNE2nS1h2LUGMDwyBUmS7crw== X-Received: by 2002:a5d:4a0b:0:b0:2fb:ca40:e42c with SMTP id m11-20020a5d4a0b000000b002fbca40e42cmr4564600wrq.6.1681913455062; Wed, 19 Apr 2023 07:10:55 -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.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 07:10:54 -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 16/19] md: raid1: use __bio_add_page for adding single page to bio Date: Wed, 19 Apr 2023 16:09:26 +0200 Message-Id: <20230419140929.5924-17-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: 51A2A140023 X-Stat-Signature: wmzx1d99bwndgzb5jf769w1zjzhjkbt3 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1681913456-818385 X-HE-Meta: U2FsdGVkX19g9E8ko7X6y3gs9izBuM7fI9CqxtUY0dR8xp3upu809Xlcvf/Kz2aY0Ke24M7jWjdJhDz1DfI1rbeUwfCaaoeXuF7xlgl2BMXZPZP3ch+zjH5LNWo8e/x1SB5Nwi1/i+AeKzz5mjYPRsPN/fcOcPenc+Q4GLML48Njxg4bVVa1Lf4HW1hH8Ohwqd1odoNPRmVbR/J0dopXrtnT+nd9aSCj+T6TqGsdC7FHZ/EVV2ARRBoHIAuVJ4Oi97g91adMu8YiGa+ZL6KjQlTHi+RNu1KL+gSDGQ7El7PqErocm/me0Wl8njpgC6TXTuRc9oObaca0FhBYw3K9GQEFD8+ayyKybq/J/aRDmw1UNZwLfDPozjoryBBiHbRhQ7UiPYhnVxht1kf5d6/kUYdyx2+KIEETkm7y4MdNMHi9XwpjxjGAso+FPqBC5iVrVr50+rT83ba2GPOSmyAYcbGEQxdAYU0D0rEDLAy5sE9Tl6irz/64zr6sAKaORHr+0QjI+wrxApsERYh8NuIU9XSErPPGt7b0QvDNhlBzPYH+Z28Fe4T4gqZOyviB/g9v1/h4JI/G8AzqY49ljq/REaJKlUV1gn+ap/cm1f+c8sO7ONSs75S3ehwtzXjJyb80MY85y59W3zOrCYC+DesDEL3T4tpiFv84iZm5QVuIa1h2a3/RnszUlr3Rjj9y1ry6TAJcbBDdeTPYuSeCQKZXEfluE+PK2ddrUBS7JBZf92pfzP+EkmrpH+59BaB4/pcbV6zM8VRhmJeEmQYXVRu5GhwUmuvwPNBeSbyadWKfVzQs2LiaPoGK5ctmDk5IxqXENw3SRGp2UPtUwmOpQGQ1hvtbOryZLs59FOlk9OVSeeUNxNpEKt0FgH8vHzk7LuQ6xL+c1t3PPd3zpGSOj8lifbOSW3GLQ/8GGFOMLAbPilgnyMSke3xoZ+F5Cz8cUWertdvBQQPVHc3d5/PtP0I S0IcrHmH 5s96jIYc5wnK1aPkRE6ZohCrAUybl0/1+h92b6MDsnRUIGSkN5UXpB2xhkm9Y2HS7kMEoTg6KXwXf7VQI9nZcJ45PJ4VXIHeg235xc9iz2TqXzg8srgczvTtSDnnP66eG0rLf6kjTRECTixcKu2f4ZiDhYXAnkdNBJBq7YmkQDvQY2KMpuCwHS2ff7yrdvCPo6tbKbPBOyAsh+DPEu8SpqmU46Na8W8fs5BdoEbOKW9Vksnex54Qy242he77Pn9aw5Bt5Vj3gAmQz0PFz9+xtXcoRxAmtMEUh8X4XuwkEo4mbhmvXW5MS5tCN3lVZHfRDG7NrFuqT8NJ8qMqACCEr12ftsQeRVdqUyeObFGNVD3UP8mN2Rh90Y772bGFEJVMl1coSpaOGSMLU0hFaVFYOlzJZlWa95aygSCcOQoI38w2IShEa+Bl30glPllSVIvEj2kBM4JyeMM9s5PbTSD2eWlmjA5TbDcyjAA65fI4X6xJf96zn4S4YBpJHJzi6TMQju2qnwZ4ec9M+lu3pUYbkqQSeJpAWW3jYKx720apJ7YgNtsndX6zdMJVDpumf2OdMDeCJgpU4tIS5AqJ36gbJMoppCyo4Rl5/K9gtwYgT/iznmYj8GNCNnCbs0r/tDviitSUr X-Bogosity: Ham, tests=bogofilter, spamicity=0.004579, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Johannes Thumshirn The sync request 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 Acked-by: Song Liu --- drivers/md/raid1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 8283ef177f6c..ff89839455ec 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -2917,7 +2917,7 @@ static sector_t raid1_sync_request(struct mddev *mddev, sector_t sector_nr, * won't fail because the vec table is big * enough to hold all these pages */ - bio_add_page(bio, page, len, 0); + __bio_add_page(bio, page, len, 0); } } nr_sectors += len>>9;