All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pankaj Raghav <pankaj.raghav@linux.dev>
To: Zhang Yi <yi.zhang@huaweicloud.com>,
	Pankaj Raghav <p.raghav@samsung.com>,
	linux-man@vger.kernel.org, Alejandro Colomar <alx@kernel.org>
Cc: linux-xfs@vger.kernel.org, "Darrick J . Wong" <djwong@kernel.org>,
	linux-ext4@vger.kernel.org, gost.dev@samsung.com, hch@lst.de
Subject: Re: [PATCH] man2/fallocate.2: add doc for FALLOC_FL_WRITE_ZEROES
Date: Thu, 20 Aug 2026 10:21:06 +0200	[thread overview]
Message-ID: <cb1857d0-f5ce-4fc2-81ac-06b39a1421f6@linux.dev> (raw)
In-Reply-To: <a2939c81-a9c0-4b26-ac2c-17e3773125b5@huaweicloud.com>

> FALLOC_FL_WRITE_ZEROES itself is relatively flexible. It does not
> mandate that the filesystem must implement zeroing via unmap write
> zeroes. That depends on the specific implementation of each filesystem.
> Currently, ext4, xfs, and block devices (bdev) support this operation
> through that approach, since writing zeros directly on devices that do
> not support unmap zeroes can be very slow and thus of little practical
> value.
> 
> Therefore, I would suggest referring to the description in, for
> example, fallocate(1):
> 
> https://man7.org/linux/man-pages/man1/fallocate.1.html
> 
>   "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."
> 
> What do you think?
> 

You are right. It is up to the FSs to implement however it wants.
I will use this framing instead. Thanks.

>> +This approach means that the specified range will be physically zeroed out
>> +on the device (including partial blocks at the either end of the range).
>> +.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 (since Linux 6.17).
>                                       ^^^^
> ext4 (only for extent-based files)
> 

Sounds good.

--
Pankaj

      reply	other threads:[~2026-08-20  8:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-19 11:40 [PATCH] man2/fallocate.2: add doc for FALLOC_FL_WRITE_ZEROES Pankaj Raghav
2026-08-19 14:30 ` Christoph Hellwig
2026-08-20  8:22   ` Pankaj Raghav
2026-08-20  7:36 ` Zhang Yi
2026-08-20  8:21   ` Pankaj Raghav [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cb1857d0-f5ce-4fc2-81ac-06b39a1421f6@linux.dev \
    --to=pankaj.raghav@linux.dev \
    --cc=alx@kernel.org \
    --cc=djwong@kernel.org \
    --cc=gost.dev@samsung.com \
    --cc=hch@lst.de \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-man@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=p.raghav@samsung.com \
    --cc=yi.zhang@huaweicloud.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.