Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6727594rwb; Tue, 15 Nov 2022 02:54:45 -0800 (PST) X-Google-Smtp-Source: AA0mqf65Bks8MFVAg4sCzYgQ8WmzwETCfDP0BNjlTiioGC+cp1nzUHsOs9C9gd2Sy9iuDDVgzRq4 X-Received: by 2002:a17:906:ae52:b0:7ad:4a55:5e19 with SMTP id lf18-20020a170906ae5200b007ad4a555e19mr13512504ejb.65.1668509684757; Tue, 15 Nov 2022 02:54:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1668509684; cv=pass; d=google.com; s=arc-20160816; b=ND5MsYTdt5FzqBKSCS7Pu2I4g0mHJleM4pQGfHZhotvnWpbm/rxJXuSplZiBMEBYyb v+sKsR2oV1DGFWJ8XtxoH32Oe9HfQPXO98WOif3lSQqRdm7SrlerLH6ljbV6R717VURQ eaVLsUaDC7/EgSvgkMqGuZOGY4REm0iZM8+4qFAAE+NqL7NbLmDeo07MRAlFjLKZdLJa p9thbOtWp8zV7dpscU9qaulckAiWuzjW0gNPNTxHLNkxlwnIKUW+w1PB6z8EAlGsDNRc U0ELqB6MMxSmDAtknPA1oPIbHAsUtaef1DldlPS6KlIrNFxwTqPn4U/Bf/C2OkE14hjH nyBg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:subject:references:cc:to:user-agent:mime-version :date:message-id:dkim-signature; bh=y0KP37fL06Ddkt/t9va+97Mqv3/Ml7gCQQoFspXKKGs=; b=Q6wT/lpF6M4TqIruYVWIWewCvJn6l4EcQNEULQjq9y+/5OD6LFJjkWMOKYeX/55GHE iDS7rk0qhIa/17tKB2BeLuQZPse+aPCWkDJtsfyZyj0syoxA//Dn6WnxPaXdnfGj4DvN wJZroz/HpqFy3xOdrEETgSq4VYv06cuz3JCY6mEN5UyfDFiU0RRQRc7GwBx/t9dL3Pqb 4goO0nJuIWl0q7wI8FFWHGd2/2rmAIUpapf4gx/rms+9WfkgAtOFoBgd0xSQj8UAufxv NQ1H8b89SmYz5Sfm8U+Zhu759jrTJ84N89Q/CZx6rFL1myiiEe863RfqhSE3axW2S7zS 5XUA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b=qU1QmqML; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=siddh.me Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id az15-20020a170907904f00b0078db8fe2834si7068090ejc.245.2022.11.15.02.54.23; Tue, 15 Nov 2022 02:54:44 -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; dkim=pass header.i=@siddh.me header.s=zmail header.b=qU1QmqML; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=siddh.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238251AbiKOKKS (ORCPT + 89 others); Tue, 15 Nov 2022 05:10:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238266AbiKOKKN (ORCPT ); Tue, 15 Nov 2022 05:10:13 -0500 Received: from sender-of-o50.zoho.in (sender-of-o50.zoho.in [103.117.158.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3680722F; Tue, 15 Nov 2022 02:10:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668506982; cv=none; d=zohomail.in; s=zohoarc; b=CW4l41oR7KZQwFhNoYv0OJy8Cd2JSMsS6ZSkl1BGBJPIFgEtzLbklxeWRT3PjxH8tpznsDCokee2X62/26iUdnNZ1C72IAhauCouyUADqO72AXWPxQCPvNTe9n1CGvl1KpMWE30PFYiKyT098QSsoxyRRy2DC+LHnFP7Q4QkI0M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.in; s=zohoarc; t=1668506982; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=y0KP37fL06Ddkt/t9va+97Mqv3/Ml7gCQQoFspXKKGs=; b=Nj4LfgTwYNFtHzNUDBzXcaNRFOI6OdF0Pv4hvEH9ULQjLaGvsErMhAGL9GzwgFS9tchP5+iYkIgDcaReIZJyhvk25AX2Xqodcf0bLke1aFn7MIcYobCOM5IBoPxd42MdnQaWcHVUIIUulrUCgxpiDB4lulEw35C0S867R6txvnw= ARC-Authentication-Results: i=1; mx.zohomail.in; dkim=pass header.i=siddh.me; spf=pass smtp.mailfrom=code@siddh.me; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1668506982; s=zmail; d=siddh.me; i=code@siddh.me; h=Message-ID:Date:Date:MIME-Version:To:To:Cc:Cc:References:Subject:Subject:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=y0KP37fL06Ddkt/t9va+97Mqv3/Ml7gCQQoFspXKKGs=; b=qU1QmqMLateIUL8kOybJ2pEVqylDaGtjC9kT5vxZrcCITWUILt5Ti2Uq8YcOzNGT 9fsqOq2xXeezL2rCGfdytpYZ2AYct4lYgSd3H+KaLTnwsnv1Ls2nXGIa0l69J+d+ftg 31DTok8axZF+bZu71TwZZNMVzmOhPQHIvU12rQwA= Received: from [192.168.1.9] (110.226.30.173 [110.226.30.173]) by mx.zoho.in with SMTPS id 1668506981538751.4796566831048; Tue, 15 Nov 2022 15:39:41 +0530 (IST) Message-ID: <917344b4-4256-6d77-b89b-07fa96ec4539@siddh.me> Date: Tue, 15 Nov 2022 15:39:38 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 To: Gao Xiang Cc: Chao Yu , Yue Hu , Jeffle Xu , linux-erofs , linux-fsdevel , linux-kernel References: Subject: Re: [RFC PATCH] erofs/zmap.c: Bail out when no further region remains Content-Language: en-US, en-GB, hi-IN From: Siddh Raman Pant In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ZohoMailClient: External X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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, 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". Alternatively, we can return error iff the length of the extent with holes is zero, like here. Thanks, Siddh