From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mta0.migadu.com (out-60.mta0.migadu.com [91.218.175.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5EC2543CEDD for ; Wed, 26 Aug 2026 14:19:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.60 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787753961; cv=none; b=agq6iLUK8gVJpTlXp4APunoR0w2dJFTVdyRi4st2USEd3L3wXMd4oigrqW62XFp+f0uHRczEbrmQ5eH9PB99TThWdNL8RcgOhvhACswolg4O0tXMn0iZYYaKdhy5Z/BvwV02CurjRewEwv6U/mOj8Ms/sX7SEn4npnEJCOpGJm4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787753961; c=relaxed/simple; bh=BFzrvzHlHAe4/1F+TkJf7+r1fkLn4+kV0pIxSnDCEKQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=HVLOYj1bAfjHWyTSN7clitfTgC2QkQzQQemaNwe86AK3YM+tG3/4/Cp6Wv+dmii6Nzx5lFTMZs1iilVFN1+fJGbD3RPGYfseEZ1LdpMBbuAGnn9SwzMBtiloVVv5kWyf/EoCeYySqiA7bexWfrDJPFvsW53SPieIdZt3HkfQjFc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=WGhpE9RH; arc=none smtp.client-ip=91.218.175.60 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="WGhpE9RH" X-Envelope-To: linux-man@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=BFzrvzHlHAe4/1F+TkJf7+r1fkLn4+kV0pIxSnDCEKQ=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1787753956; v=1; x=1788358756; b=WGhpE9RHNzWYz8vjamNzy1IE6A29o3CL+lBz8kXJGvrBOEb3pqjAIrC/y91599RI1g2nVRxd M3PrarumPq784QLZ3J0EysE5FDh9h/BLn165zHiGc5gTFDjG4f7Ma5P1UyWrS+5X5Grjway9uFx XUtoeP9cr/fOZYgPrOeroq0U= X-Envelope-To: linux-man@vger.kernel.org Received: from [192.168.8.140] (87.104.0.147) by smtp.migadu.com with ESMTPS id b5317998026f67d0; Wed, 26 Aug 2026 14:19:16 +0000 X-Mizu-Trace-ID: b5317998026f67d0 X-Migadu-Flow: FLOW_OUT Message-ID: Date: Wed, 26 Aug 2026 16:19:11 +0200 Precedence: bulk X-Mailing-List: linux-man@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] man2/fallocate.2: add doc for FALLOC_FL_WRITE_ZEROES To: Alejandro Colomar , Pankaj Raghav Cc: linux-man@vger.kernel.org, hch@lst.de, Zhang Yi , linux-xfs@vger.kernel.org, gost.dev@samsung.com, "Darrick J . Wong" , linux-ext4@vger.kernel.org References: <20260820090400.857720-1-p.raghav@samsung.com> Content-Language: en-US From: Pankaj Raghav In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 8/22/2026 2:41 PM, Alejandro Colomar wrote: > Hi Pankaj, Christoph, > >> Date: 2026-08-20 11:04:00+0200 >> From: Pankaj Raghav >> Subject: Re: [PATCH v2] man2/fallocate.2: add doc for FALLOC_FL_WRITE_ZEROES > > We use the full path in the prefix. That is, 'man/man2/...: ...'. > Also, we use regular sentence conventions for the first letter after > the ':', so s/add/Add/. > Got it. >> This flag was added to the kernel in v6.17. As of now, only ext4 and > > Please use two spaces after period. > > Ok! >> block device nodes support this flag. >> >> Signed-off-by: Pankaj Raghav > > Please include the CC list here too. > >> --- >> Changes since v1: >> - Change the phrasing around zeroing and its condition (Zhang Yi) >> - Update ext4 support only for extent-based files (Zhang Yi) >> >> Note: >> This feature was recently added to XFS and it is expected to land in >> v7.13. I will update this man page again once v7.13 is released. >> >> man/man2/fallocate.2 | 38 ++++++++++++++++++++++++++++++++++++++ >> 1 file changed, 38 insertions(+) >> >> diff --git a/man/man2/fallocate.2 b/man/man2/fallocate.2 >> index ef6586c77..48a8c3468 100644 >> --- a/man/man2/fallocate.2 >> +++ b/man/man2/fallocate.2 >> @@ -244,6 +244,43 @@ SMB3 (since Linux 3.17) >> .IP \[bu] >> Btrfs (since Linux 4.16) >> .\" commit f27451f229966874a8793995b8e6b74326d125df >> +.SS Writing zeroes in file space >> +Specifying the >> +.B FALLOC_FL_WRITE_ZEROES >> +flag (available since Linux 6.17) >> +.\" commit 7bd43cc79cab3850f34da0a31d5b042b701590ef >> +in >> +.I mode >> +physically zeros space in the byte range starting at >> +.I offset >> +and continuing for >> +.I size >> +bytes. >> +Within the specified range, >> +blocks are preallocated for the regions that span the holes > > What does it mean that "blocks are preallocated"? That they must be > allocated prior to this call? I suspect not. Otherwise, we'd be saying > 'must be' instead of 'are'. > I guess preallocate in this context means unmapped blocks where we guarantee space for an application. > I suspect it means that this call allocates blocks for those regions, > but then I'm not sure we want 'pre' there. > You are right. The blocks are allocated when we use FL_WRITE_ZEROES (they should be marked as MAPPED). I will change it here. I guess the man pages for util linux also needs to be changed[1]. @Zhang Yi, thoughts? >> +in the file. >> +After a successful call, >> +subsequent reads from this range will return zeros and >> +subsequent writes to that range do not require further >> +changes to the file mapping metadata. >> +.P >> +Zeroing is done within the filesystem. >> +The filesystem may use a hardware-accelerated zeroing command >> +or may submit regular writes. >> +The behavior depends on the filesystem design and the >> +available hardware. >> +.P >> +No other flags may be specified in >> +.I mode >> +in conjunction with >> +.BR FALLOC_FL_WRITE_ZEROES . >> +.P >> +Not all filesystems support >> +.BR FALLOC_FL_WRITE_ZEROES ; >> +if a filesystem doesn't support the operation, an error is returned. >> +The operation is supported only in ext4 (only for extent-based files) >> +since Linux 6.17. > > Christoph, is this correct? I remember you said something about block > device nodes in v1. > Even though block devices support some of the FALLOC_FL_* flags, I don't see it mentioned here as explicitly supported. That is why I kept it out of the changes. Let me know your thoughts. Thanks for the feedback. -- Pankaj [1] https://man7.org/linux/man-pages/man1/fallocate.1.html