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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B30B1C6FD1C for ; Sat, 25 Mar 2023 08:38:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232369AbjCYIiT (ORCPT ); Sat, 25 Mar 2023 04:38:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232260AbjCYIhc (ORCPT ); Sat, 25 Mar 2023 04:37:32 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5079193EC for ; Sat, 25 Mar 2023 01:37:16 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id E358168AA6; Sat, 25 Mar 2023 09:37:12 +0100 (CET) Date: Sat, 25 Mar 2023 09:37:12 +0100 From: Christoph Hellwig To: Naohiro Aota Cc: Christoph Hellwig , Chris Mason , Josef Bacik , David Sterba , Boris Burkov , Johannes Thumshirn , "linux-btrfs@vger.kernel.org" Subject: Re: [PATCH 06/11] btrfs: simplify btrfs_split_ordered_extent Message-ID: <20230325083712.GC7598@lst.de> References: <20230324023207.544800-1-hch@lst.de> <20230324023207.544800-7-hch@lst.de> <20230324075248.37cagxzdugxjovlp@naota-xeon> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230324075248.37cagxzdugxjovlp@naota-xeon> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Fri, Mar 24, 2023 at 07:52:49AM +0000, Naohiro Aota wrote: > > + /* The bio must be entirely covered by the ordered extent */ > > + if (WARN_ON_ONCE(len > ordered->num_bytes)) > > + return -EINVAL; > > Can we also reject "len == ordered->num_bytes" case here? So, we will never > modify the ordered extent to have > ordered->{num_bytes,disk_num_bytes,bytes_left} == 0. Sure, I've replaced the > with a >= and expanded the comment.