From patchwork Thu Apr 20 10:04:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13218368 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D1A7C77B73 for ; Thu, 20 Apr 2023 10:06:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234643AbjDTKGx (ORCPT ); Thu, 20 Apr 2023 06:06:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234567AbjDTKGN (ORCPT ); Thu, 20 Apr 2023 06:06:13 -0400 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCB8655A7; Thu, 20 Apr 2023 03:06:02 -0700 (PDT) Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-2fe3fb8e25fso287249f8f.0; Thu, 20 Apr 2023 03:06:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681985161; x=1684577161; 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=XSziFxMRLlc78BEY3ZIcArKRUqB+ur0VzFu/o2eWTQg=; b=QkWtFTdA8NX1Y3c8FfABJmB3YmKmnSnQ/t3ZvMuD/2IktZT6tpCg9DxPKH9gsC+QkJ dSKPDtM5KYkBiugQ393dM54xvbcbPQ1mZCDQDFgdCSnjGwgyzH6ODRcPyqeiWfRgdP8H LI0TG2l/JmsiKiEpMMEzRYnYahW9OsxX45blghbOkjia9dwifbL3lN05wYcOh6rSrjY9 gZW8ia9RqyePigZMISVsmNyV3CzXxDxFzOClvrQiJNqKZwPX31R5lizSEe+QeBVF3SE6 RE+6iy3c84h2SGcy3hiKXdObtxqThC+TARsGfSizT13wR2GeZXM5kR6bcutRfRs8GwM2 VgMA== X-Gm-Message-State: AAQBX9dTrNeTRZmviCJQI+RW3NYyAXetblC/FbBph+jLjDq705g/vd5T RRwFSq2gNvyvt7s5c1NV85Y= X-Google-Smtp-Source: AKy350YaG3KN92VetUrzcVoSFywGceMQufxfAD2B5CXNNTFsILzF+cTK0i2X3r4O7jeyW50fb6yefQ== X-Received: by 2002:a05:6000:1105:b0:2ff:f37:9d02 with SMTP id z5-20020a056000110500b002ff0f379d02mr782954wrw.69.1681985161137; Thu, 20 Apr 2023 03:06:01 -0700 (PDT) Received: from localhost.localdomain (aftr-62-216-205-208.dynamic.mnet-online.de. [62.216.205.208]) by smtp.googlemail.com with ESMTPSA id l11-20020a5d674b000000b0030276f42f08sm201410wrw.88.2023.04.20.03.06.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Apr 2023 03:06:00 -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 v4 09/22] btrfs: raid56: use __bio_add_page to add single page Date: Thu, 20 Apr 2023 12:04:48 +0200 Message-Id: <20230420100501.32981-10-jth@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230420100501.32981-1-jth@kernel.org> References: <20230420100501.32981-1-jth@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org From: Johannes Thumshirn The btrfs raid58 sector submission 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 --- fs/btrfs/raid56.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c index 642828c1b299..c8173e003df6 100644 --- a/fs/btrfs/raid56.c +++ b/fs/btrfs/raid56.c @@ -1108,7 +1108,7 @@ static int rbio_add_io_sector(struct btrfs_raid_bio *rbio, bio->bi_iter.bi_sector = disk_start >> 9; bio->bi_private = rbio; - bio_add_page(bio, sector->page, sectorsize, sector->pgoff); + __bio_add_page(bio, sector->page, sectorsize, sector->pgoff); bio_list_add(bio_list, bio); return 0; }