From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 30F1A35AC18; Thu, 18 Jun 2026 08:59:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781773161; cv=none; b=CJ+33Pt9Nevu4yoH//jdgabrMyVRFKQTqRrJYiZspX/+nJeUKzI08HcWl2ydo/LLtNZOZoOwIpEGy1yIwUlKfdgnM9Uum6AmLQ3cDKgMR6VDfRtCzDb/4avjEsDpis+m5Y3sLwnS3mxSE1BVJrU5vUOKThgPEFIJ1vMRdU+q2ns= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781773161; c=relaxed/simple; bh=v6pQZXAs9UpEBlJYlQQsCzG5T2POmZpYbsOZVCT4vOM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=JCDW3Ug5AYJeXLtI8aDtNwABHOlqPi6BoGhpOSy0H/8YewGVCEQy7eYkb/YMMGalo1MzTvfkYtqxK2kmSV7Izdg+nwysR9HDRzF6WLngsNTcvvJAjESDgYk49jcGNJWRjH76MyPRIQTE8J6gasHwvtvmNJ+RFAZdwQKT/3Fveag= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=PWIYxgl3; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="PWIYxgl3" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=TMdTlnQWOCQk+DM25bXY+39Q+J1e9amcG79qXlD1w2g=; b=PWIYxgl3oX8Fea0U/ybb/Lasxv x5Ki1YCwu95oMnKbBFNEeBaFORdVbm4XkH0Jv1ltXFDJI1OnJQQ0NdCDc47JfgxniHf4g4HfJvMKS sa+eEqRBiKMv0J6IXF0oYwaNdh9Z5GF6rHRKn/mMLaqclY57luEfiD0ITTI1Ik7XVp7t5g12Z3jVL E05jQtUX++xJd461e0uaTR7h6QxGsCSA3+2lIO3jasOZRU7HGYoI8JG0n954bxKKCudsw1eTm0Xut iop2ti6d510sCpENdiZbOcBHKKari5hKuCqGlhj4gzfDMgC0CekgBOpxhmexgv+rTn+3BHd2Uy4Te kxDfusvw==; Received: from hch by bombadil.infradead.org with local (Exim 4.99.1 #2 (Red Hat Linux)) id 1wa8ak-00000000t5e-3Jmi; Thu, 18 Jun 2026 08:59:18 +0000 Date: Thu, 18 Jun 2026 01:59:18 -0700 From: Christoph Hellwig To: Zhang Yi Cc: "Pankaj Raghav (Samsung)" , Pankaj Raghav , linux-xfs@vger.kernel.org, bfoster@redhat.com, lukas@herbolt.com, "Darrick J . Wong" , dgc@kernel.org, gost.dev@samsung.com, andres@anarazel.de, kundan.kumar@samsung.com, cem@kernel.org, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org Subject: Re: [PATCH v6 3/3] xfs: add support for FALLOC_FL_WRITE_ZEROES Message-ID: References: <20260611114029.176200-4-p.raghav@samsung.com> <557b2e5c-7c65-48de-87a9-6fba21eca99f@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-api@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <557b2e5c-7c65-48de-87a9-6fba21eca99f@huaweicloud.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html On Thu, Jun 18, 2026 at 11:22:45AM +0800, Zhang Yi wrote: > 1) if the two blocks straddling the boundaries have not yet been allocated, > or allocated as unwritten, we should round outward the allocation range > and zero out all allocated blocks, including those two boundary blocks. > 2) if the blocks at the boundaries are already in the written state — which > can occur when we call FALLOC_FL_WRITE_ZEROES within the file size. We > should be careful here: we should only zero the ranges [offset, offset_ru) > and [end_rd, end) for the boundary blocks, leaving the already-written > portions of the boundary blocks intact. > > Thoughs? Yes. > Regarding the second point, the current ext4 implementation has an issue — > it zeroes out the entire boundary blocks. I overlooked this previously, and > I appreciate you pointing it out. Which means we're missing test coverage for this as well..