* Re: [PATCH v2] man2/fallocate.2: add doc for FALLOC_FL_WRITE_ZEROES
2026-08-20 9:04 [PATCH v2] man2/fallocate.2: add doc for FALLOC_FL_WRITE_ZEROES Pankaj Raghav
@ 2026-08-20 9:28 ` Alejandro Colomar
2026-08-20 9:31 ` Pankaj Raghav
2026-08-21 3:39 ` Zhang Yi
2026-08-22 12:41 ` Alejandro Colomar
2 siblings, 1 reply; 7+ messages in thread
From: Alejandro Colomar @ 2026-08-20 9:28 UTC (permalink / raw)
To: Pankaj Raghav
Cc: linux-man, pankaj.raghav, hch, Zhang Yi, linux-xfs, gost.dev,
Darrick J . Wong, linux-ext4
[-- Attachment #1: Type: text/plain, Size: 2738 bytes --]
Hi Pankaj,
> Date: 2026-08-20 11:04:00+0200
> From: Pankaj Raghav <p.raghav@samsung.com>
>
> This flag was added to the kernel in v6.17. As of now, only ext4 and
> block device nodes support this flag.
>
> Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
> ---
> 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.
Do you really mean Linux v7.13?
Have a lovely day!
Alex
>
> 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
> +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.
> +.\" commit f4265b8d32c49ff95711e6fef7d05245a2905b30
> .SS Increasing file space
> Specifying the
> .B FALLOC_FL_INSERT_RANGE
> @@ -385,6 +422,7 @@ or
> is
> .BR FALLOC_FL_COLLAPSE_RANGE ,
> .BR FALLOC_FL_ZERO_RANGE ,
> +.BR FALLOC_FL_WRITE_ZEROES ,
> or
> .BR FALLOC_FL_INSERT_RANGE ,
> but the file referred to by
>
> base-commit: d926b42e0ea0406d5c2556e18205eced92d053f1
> --
> 2.51.2
>
--
<https://www.alejandro-colomar.es>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] man2/fallocate.2: add doc for FALLOC_FL_WRITE_ZEROES
2026-08-20 9:28 ` Alejandro Colomar
@ 2026-08-20 9:31 ` Pankaj Raghav
0 siblings, 0 replies; 7+ messages in thread
From: Pankaj Raghav @ 2026-08-20 9:31 UTC (permalink / raw)
To: Alejandro Colomar, Pankaj Raghav
Cc: linux-man, hch, Zhang Yi, linux-xfs, gost.dev, Darrick J . Wong,
linux-ext4
On 8/20/26 11:28, Alejandro Colomar wrote:
> Hi Pankaj,
>
>> Date: 2026-08-20 11:04:00+0200
>> From: Pankaj Raghav <p.raghav@samsung.com>
>>
>> This flag was added to the kernel in v6.17. As of now, only ext4 and
>> block device nodes support this flag.
>>
>> Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
>> ---
>> 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.
>
> Do you really mean Linux v7.13?
>
>
Oops. I mean v7.3 :)
--
Pankaj
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] man2/fallocate.2: add doc for FALLOC_FL_WRITE_ZEROES
2026-08-20 9:04 [PATCH v2] man2/fallocate.2: add doc for FALLOC_FL_WRITE_ZEROES Pankaj Raghav
2026-08-20 9:28 ` Alejandro Colomar
@ 2026-08-21 3:39 ` Zhang Yi
2026-08-22 12:41 ` Alejandro Colomar
2 siblings, 0 replies; 7+ messages in thread
From: Zhang Yi @ 2026-08-21 3:39 UTC (permalink / raw)
To: Pankaj Raghav, linux-man, Alejandro Colomar
Cc: pankaj.raghav, hch, linux-xfs, gost.dev, Darrick J . Wong,
linux-ext4
On 8/20/2026 5:04 PM, Pankaj Raghav wrote:
> This flag was added to the kernel in v6.17. As of now, only ext4 and
> block device nodes support this flag.
>
> Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
Looks good to me. Thanks!
Reviewed-by: Zhang Yi <yi.zhang@huawei.com>
> ---
> 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
> +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.
> +.\" commit f4265b8d32c49ff95711e6fef7d05245a2905b30
> .SS Increasing file space
> Specifying the
> .B FALLOC_FL_INSERT_RANGE
> @@ -385,6 +422,7 @@ or
> is
> .BR FALLOC_FL_COLLAPSE_RANGE ,
> .BR FALLOC_FL_ZERO_RANGE ,
> +.BR FALLOC_FL_WRITE_ZEROES ,
> or
> .BR FALLOC_FL_INSERT_RANGE ,
> but the file referred to by
>
> base-commit: d926b42e0ea0406d5c2556e18205eced92d053f1
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] man2/fallocate.2: add doc for FALLOC_FL_WRITE_ZEROES
2026-08-20 9:04 [PATCH v2] man2/fallocate.2: add doc for FALLOC_FL_WRITE_ZEROES Pankaj Raghav
2026-08-20 9:28 ` Alejandro Colomar
2026-08-21 3:39 ` Zhang Yi
@ 2026-08-22 12:41 ` Alejandro Colomar
2026-08-26 14:19 ` Pankaj Raghav
2 siblings, 1 reply; 7+ messages in thread
From: Alejandro Colomar @ 2026-08-22 12:41 UTC (permalink / raw)
To: Pankaj Raghav
Cc: linux-man, pankaj.raghav, hch, Zhang Yi, linux-xfs, gost.dev,
Darrick J . Wong, linux-ext4
[-- Attachment #1: Type: text/plain, Size: 3537 bytes --]
Hi Pankaj, Christoph,
> Date: 2026-08-20 11:04:00+0200
> From: Pankaj Raghav <p.raghav@samsung.com>
> 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/.
> This flag was added to the kernel in v6.17. As of now, only ext4 and
Please use two spaces after period.
<https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/tree/CONTRIBUTING.d/patches/description#n44>
> block device nodes support this flag.
>
> Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
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 suspect it means that this call allocates blocks for those regions,
but then I'm not sure we want 'pre' there.
> +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.
Have a lovely day!
Alex
> +.\" commit f4265b8d32c49ff95711e6fef7d05245a2905b30
> .SS Increasing file space
> Specifying the
> .B FALLOC_FL_INSERT_RANGE
> @@ -385,6 +422,7 @@ or
> is
> .BR FALLOC_FL_COLLAPSE_RANGE ,
> .BR FALLOC_FL_ZERO_RANGE ,
> +.BR FALLOC_FL_WRITE_ZEROES ,
> or
> .BR FALLOC_FL_INSERT_RANGE ,
> but the file referred to by
>
> base-commit: d926b42e0ea0406d5c2556e18205eced92d053f1
> --
> 2.51.2
>
--
<https://www.alejandro-colomar.es>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] man2/fallocate.2: add doc for FALLOC_FL_WRITE_ZEROES
2026-08-22 12:41 ` Alejandro Colomar
@ 2026-08-26 14:19 ` Pankaj Raghav
2026-08-27 1:28 ` Zhang Yi
0 siblings, 1 reply; 7+ messages in thread
From: Pankaj Raghav @ 2026-08-26 14:19 UTC (permalink / raw)
To: Alejandro Colomar, Pankaj Raghav
Cc: linux-man, hch, Zhang Yi, linux-xfs, gost.dev, Darrick J . Wong,
linux-ext4
On 8/22/2026 2:41 PM, Alejandro Colomar wrote:
> Hi Pankaj, Christoph,
>
>> Date: 2026-08-20 11:04:00+0200
>> From: Pankaj Raghav <p.raghav@samsung.com>
>> 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.
> <https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/tree/CONTRIBUTING.d/patches/description#n44>
>
Ok!
>> block device nodes support this flag.
>>
>> Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
>
> 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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] man2/fallocate.2: add doc for FALLOC_FL_WRITE_ZEROES
2026-08-26 14:19 ` Pankaj Raghav
@ 2026-08-27 1:28 ` Zhang Yi
0 siblings, 0 replies; 7+ messages in thread
From: Zhang Yi @ 2026-08-27 1:28 UTC (permalink / raw)
To: Pankaj Raghav, Alejandro Colomar, Pankaj Raghav
Cc: linux-man, hch, linux-xfs, gost.dev, Darrick J . Wong, linux-ext4
On 8/26/2026 10:19 PM, Pankaj Raghav wrote:
> On 8/22/2026 2:41 PM, Alejandro Colomar wrote:
>> Hi Pankaj, Christoph,
>>
>>> Date: 2026-08-20 11:04:00+0200
>>> From: Pankaj Raghav <p.raghav@samsung.com>
>>> 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.
>> <https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/tree/CONTRIBUTING.d/patches/description#n44>
>>
>
> Ok!
>
>>> block device nodes support this flag.
>>>
>>> Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
>>
>> 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?
I personally understand the 'pre' in FL_WRITE_ZEROES to mean that
users are calling this interface to pre-allocate filesystem blocks
before they actually start writing data, rather than having blocks
allocated on the fly during actual writes. That said, I don't think
pre-allocated necessarily implies that the blocks must be UNMAPPED. In
my view, UNMAPPED allocations can be considered a form of pre-allocation,
but MAPPED ones could also be seen that way, since at the time the user
calls this interface, they haven't yet written any real data and are
just preparing the blocks in advance. From a user's perspective, both
cases can be understood as pre-allocation.
That's just my take on it, though. It's fine by me to change it to
allocated as well.
Thanks,
Yi.
>
>>> +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
^ permalink raw reply [flat|nested] 7+ messages in thread