From mboxrd@z Thu Jan 1 00:00:00 1970 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 A201CC7EE23 for ; Tue, 2 May 2023 15:20:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 384D76B0085; Tue, 2 May 2023 11:20:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 30DB66B0087; Tue, 2 May 2023 11:20:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1D5896B0088; Tue, 2 May 2023 11:20:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by kanga.kvack.org (Postfix) with ESMTP id 006386B0085 for ; Tue, 2 May 2023 11:20:27 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683040827; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kdZho8b0P96S/DuDI1xyFnU41Cvk0heUauLxuFmvVg0=; b=JMIFwhyu6gFshCUeleBSSSqAsqc1NdUJZJXOJrIWrl02WZEESWf8ftxvJ3NlyttvvJ277v Gsz7Xi4cqoRH1VdPFyUOw5jPfLRf5VmxfpVaktnKAsSQVRfO4yrGU6x90ngNu6g4aM1UWU 5hFuJGhQNNQ5eLmK0Vh9K0K1wCLDPQE= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-292-vwIQ6JEYM0yCjqxsbFIAQw-1; Tue, 02 May 2023 07:51:04 -0400 X-MC-Unique: vwIQ6JEYM0yCjqxsbFIAQw-1 Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-3f17f39d3deso49220411cf.3 for ; Tue, 02 May 2023 04:51:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683028264; x=1685620264; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=kdZho8b0P96S/DuDI1xyFnU41Cvk0heUauLxuFmvVg0=; b=ShvyuZVKMxE4RolYvqePapbIE1TsQmy1W80BmzPbgjW/vRCeEM3dA3w9VDxQ6XVBoz RfpP63uNcYdZt/bM9euLpqkLIVWvs5r9m47V/pWbbGHgUQSUCDMg+5i8hYpfB85/rzKl QsKfX9krdecW2idlOn0qmO9nY5QY9bPVF+3lDQbZOhqNJ8W/t/6g1cSoBtrDAi+66cY0 bpvawKV7XMOzKGovW9kJ+GkSAHT54vDRUFpK8vkcjb/oFSzfptB1RwUnsGhMDuavsi9t KYlPhXV67aI3jqLYfzId24PwLpBzE3sR5chgLqRJgsbOUXmHG9HesS7AeP/rGDqCmi6T 1dtg== X-Gm-Message-State: AC+VfDykErIdu3ZqfVPu+Eyua/+kXrniDT0550piORA44oJb57dtdyGX DrX/q9EqixZgM6VQRcxsXiRPmtFEoOHJIOPR6qrInYM2Pu5z+dFKRdET8qvR0D07xxk0uu5joDK 05rHAOf9qTyA= X-Received: by 2002:a05:622a:30f:b0:3ef:337b:4fcb with SMTP id q15-20020a05622a030f00b003ef337b4fcbmr28295414qtw.64.1683028264043; Tue, 02 May 2023 04:51:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Vrqw+pKj/0O/fsSqYR2NNR+qseAedVJ76NoenSc8LVgBigL4KUU+oPaikQc4zPyJmE8NtjQ== X-Received: by 2002:a05:622a:30f:b0:3ef:337b:4fcb with SMTP id q15-20020a05622a030f00b003ef337b4fcbmr28295396qtw.64.1683028263837; Tue, 02 May 2023 04:51:03 -0700 (PDT) Received: from ?IPV6:2601:883:c200:210:6ae9:ce2:24c9:b87b? ([2601:883:c200:210:6ae9:ce2:24c9:b87b]) by smtp.gmail.com with ESMTPSA id fd9-20020a05622a4d0900b003d65e257f10sm6632958qtb.79.2023.05.02.04.51.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 02 May 2023 04:51:02 -0700 (PDT) Message-ID: <5f3ddda1-2c7d-811c-ffd5-5fc237def2eb@redhat.com> Date: Tue, 2 May 2023 07:51:00 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH v5 09/20] gfs2: use __bio_add_page for adding single page to bio To: Johannes Thumshirn , "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, shaggy@kernel.org, snitzer@kernel.org, song@kernel.org, willy@infradead.org, Damien Le Moal References: <20230502101934.24901-1-johannes.thumshirn@wdc.com> <20230502101934.24901-10-johannes.thumshirn@wdc.com> From: Bob Peterson In-Reply-To: <20230502101934.24901-10-johannes.thumshirn@wdc.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 5/2/23 6:19 AM, Johannes Thumshirn wrote: > The GFS2 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. > > Reviewed-by: Damien Le Moal > Reviewed-by: Andreas Gruenbacher > Signed-off-by: Johannes Thumshirn > --- > 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 9af9ddb61ca0..cd962985b058 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; Hi Johannes, So...I see 6 different calls to bio_add_page() in gfs2. Why change this particular bio_add_page() to __bio_add_page() and not the other five? Regards, Bob Peterson