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.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 90E89C43461 for ; Fri, 11 Sep 2020 17:20:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3BFB5221ED for ; Fri, 11 Sep 2020 17:20:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="gjqxNSJh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726254AbgIKRTx (ORCPT ); Fri, 11 Sep 2020 13:19:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726148AbgIKO5e (ORCPT ); Fri, 11 Sep 2020 10:57:34 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5252FC061349; Fri, 11 Sep 2020 07:17:23 -0700 (PDT) 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=hY9rmfrv8UCuGHdrvMA74LoUacs54okGTn77tgIOUTg=; b=gjqxNSJhTHRI78NdQ0N+CiZ7aa 8XuuMyP7Bup4JqKaiohZzpS/aPpZM7QZkyein2/NrRK0U9Bcmz1TmQNJ6ED+ISDuwZqx0HnpHlHOz UgsO1nXNSRG1za4KU+Tyk+jvpcP6rCyQckymDzhVTdIMTlmSEgxU+SMybyflZAAx23QdXsOiKJGfz DXjjudLlTaQyNREvphjeGK3/Xr+BA3qlfnw4TzAf98OWkVo+j1xC5DuWcmchf74jlMBVLo3XRFIjv b/WKmmWiS1cNVGowM8BsmHFcuOKZZoWRJ4DHSX0sMiYRdTOY6Lf0bcwtP49bBeZQvLLkgVU6DVWV0 M32EEAEg==; Received: from hch by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGjrb-0004AW-9r; Fri, 11 Sep 2020 14:17:19 +0000 Date: Fri, 11 Sep 2020 15:17:19 +0100 From: Christoph Hellwig To: Naohiro Aota Cc: linux-btrfs@vger.kernel.org, David Sterba , Chris Mason , Josef Bacik , Hannes Reinecke , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v7 19/39] btrfs: limit bio size under max_zone_append_size Message-ID: <20200911141719.GA15317@infradead.org> References: <20200911123259.3782926-1-naohiro.aota@wdc.com> <20200911123259.3782926-20-naohiro.aota@wdc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200911123259.3782926-20-naohiro.aota@wdc.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Fri, Sep 11, 2020 at 09:32:39PM +0900, Naohiro Aota wrote: > + if (fs_info->max_zone_append_size && > + bio_op(bio) == REQ_OP_WRITE && > + bio->bi_iter.bi_size + size > fs_info->max_zone_append_size) > + can_merge = false; > + > if (prev_bio_flags != bio_flags || !contig || !can_merge || > force_bio_submit || > bio_add_page(bio, page, page_size, pg_offset) < page_size) { For zoned devices you need to use bio_add_hw_page instead of so that all the hardware restrictions are applied. bio_add_hw_page asso gets the lenght limited passed as the last parameter so we won't need a separate check.