Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6749912rwb; Tue, 15 Nov 2022 03:13:55 -0800 (PST) X-Google-Smtp-Source: AA0mqf5QELQQbdCTsZRRTLOSF1xXWAI2ciZAu7n7w/0VusR0b4HRiIj3mNTrbMC5poqlmm2EOzEQ X-Received: by 2002:a05:6a00:27a3:b0:563:771d:417f with SMTP id bd35-20020a056a0027a300b00563771d417fmr17831096pfb.45.1668510834874; Tue, 15 Nov 2022 03:13:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668510834; cv=none; d=google.com; s=arc-20160816; b=eLnT1koL9oMrLgtDj3Jv8QqkSunJ4KhcZ3MzNB3gEQArX207I6Z6CtJnjqBmaPmgMq fz5tX1s45uh1JdeVvVgrlurpqS/9OpLkXvDShhZYFypG+5VNUHsuHbuSiR/EOLn7TAKO wBCDruEZ+Ri2e/q6VCPnb9pP0cYj0jvzV7Ybc8ghCIYefudS7il3B2BTnVyjsG4DDTbQ Lbac7jUuwjj60tb9IGc0Z4uh+zINgz1wKq6Q0RCjirR7CMDGqRPN2D0z2MxAAj6t4wH3 SVIscQzPLq9j5ss9dcUjpIDjjZrJzyxqSkUKxEL2I4LX2ABJ+uZ7FBoa30s04PNdgS4/ zjug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date; bh=BZWiJByPrYgZ/pNLZ7vu+wpnI3Jji86hvtd8IYqP67I=; b=q5l20oHj7AymKhVsmKsz4OzCo3tc2P2nTwDD/YJaBRGwBOZdbrrjkSQpau1BnOL+yj uNTXSWHzChwJo4CxYccdvmx3gCCe1wL/47lcdYa2TU7T4AhkwHO8LZgcHCP/MTd19gba 6svkxpCZkb3Xy4rwBnYULg3aPeoVuSSZsSfqhA13Q7cIDOTS6WvtPd1lSoZMkI4E/L8a MTvZB6SPD/ACoSOOpm8LvJokNe+WjjvaYSGFrhhrzCP9DYM/W0vf0dE6tX0ATbioqv4P pKgC+IbCJ9yNFEKyMhXc/z9a/cC/i+mRzUo4dWnErhpx5aFjoPDiq9/Zbs0smIarJcEC //sQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j191-20020a6380c8000000b00476a48051f9si2654972pgd.13.2022.11.15.03.13.42; Tue, 15 Nov 2022 03:13:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238293AbiKOKvi (ORCPT + 89 others); Tue, 15 Nov 2022 05:51:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232808AbiKOKu5 (ORCPT ); Tue, 15 Nov 2022 05:50:57 -0500 Received: from out30-133.freemail.mail.aliyun.com (out30-133.freemail.mail.aliyun.com [115.124.30.133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4EB0233AC; Tue, 15 Nov 2022 02:50:38 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R171e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046049;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0VUtE0x-_1668509434; Received: from B-P7TQMD6M-0146.local(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0VUtE0x-_1668509434) by smtp.aliyun-inc.com; Tue, 15 Nov 2022 18:50:36 +0800 Date: Tue, 15 Nov 2022 18:50:33 +0800 From: Gao Xiang To: Siddh Raman Pant Cc: linux-kernel , linux-fsdevel , Yue Hu , linux-erofs Subject: Re: [RFC PATCH] erofs/zmap.c: Bail out when no further region remains Message-ID: Mail-Followup-To: Siddh Raman Pant , linux-kernel , linux-fsdevel , Yue Hu , linux-erofs References: <917344b4-4256-6d77-b89b-07fa96ec4539@siddh.me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <917344b4-4256-6d77-b89b-07fa96ec4539@siddh.me> X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 15, 2022 at 03:39:38PM +0530, Siddh Raman Pant via Linux-erofs wrote: > On Tue, 15 Nov 2022 08:54:47 +0530, Gao Xiang wrote: > > I just wonder if we should return -EINVAL for post-EOF cases or > > IOMAP_HOLE with arbitrary length? > > Since it has been observed that length can be zeroed, and we > must stop, I think we should return an error appropriately. > > For a read-only filesystem, we probably don't really need to > care what's after the EOF or in unmapped regions, nothing can > be changed/extended. The definition of IOMAP_HOLE in iomap.h > says it stands for "no blocks allocated, need allocation". For fiemap implementation, yes. So it looks fine to me. Let's see what other people think. Anyway, I'd like to apply it later. Thanks, Gao Xiang > > Alternatively, we can return error iff the length of the > extent with holes is zero, like here. > > Thanks, > Siddh