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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA028C55ABD for ; Tue, 10 Nov 2020 17:20:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 68CB220809 for ; Tue, 10 Nov 2020 17:20:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="FTUqYVwL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726428AbgKJRU1 (ORCPT ); Tue, 10 Nov 2020 12:20:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726179AbgKJRU1 (ORCPT ); Tue, 10 Nov 2020 12:20:27 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3653C0613CF; Tue, 10 Nov 2020 09:20:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=WtLvsd+PYLZ22ThXIUu3CAFmse0F4aW6/fbAcYoCw14=; b=FTUqYVwLnXUVDbRTL9D23EwKzL nbr36rcEvhZXC/NWQTMlw0o1GdJwiczY3v6/zsoSJ0jdqUQBcngMIDDLJTCcGnHtgwb+3TKkhhavK bDeB0n+obsqGwOs3lCcYmrMqS1HWzKP6o6vObJUo2cF+xnqLB48DWk4Vj9CurBd3aFSGQBc+sCV0o k2UBaTZfrbtp3hNVINynswQf5LlpVtken9f6t1eHmD9wW8dHDcdjeFZHLElAtJ1TP9HorDSjucikO vZN+l3F/rsenhjMkjquI3/Kym6OTMxbNMkfIQGGcVE37UrgtgCjBIdOyHYd3rsO0S1hbtMA+8MNCt I4aEbBvA==; Received: from hch by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcXJf-000622-RZ; Tue, 10 Nov 2020 17:20:23 +0000 Date: Tue, 10 Nov 2020 17:20:23 +0000 From: Christoph Hellwig To: Naohiro Aota Cc: linux-btrfs@vger.kernel.org, dsterba@suse.com, hare@suse.com, linux-fsdevel@vger.kernel.org, Jens Axboe , Christoph Hellwig , "Darrick J. Wong" , Johannes Thumshirn Subject: Re: [PATCH v10 01/41] block: add bio_add_zone_append_page Message-ID: <20201110172023.GA22758@infradead.org> References: <01fbaba7b2f2404489b5779e1719ebf3d062aadc.1605007036.git.naohiro.aota@wdc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <01fbaba7b2f2404489b5779e1719ebf3d062aadc.1605007036.git.naohiro.aota@wdc.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org > +int bio_add_zone_append_page(struct bio *bio, struct page *page, > + unsigned int len, unsigned int offset) > +{ > + struct request_queue *q; > + bool same_page = false; > + > + if (WARN_ON_ONCE(bio_op(bio) != REQ_OP_ZONE_APPEND)) > + return 0; > + > + if (WARN_ON_ONCE(!bio->bi_disk)) > + return 0; Do we need this check? I'd rather just initialize q at declaration time and let the NULL pointer deref be the obvious sign for a grave programming error.. Except for that the patch looks good to me: Reviewed-by: Christoph Hellwig