[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z3wEhXakqrW4i3UC@infradead.org>
Date: Mon, 6 Jan 2025 08:27:49 -0800
From: Christoph Hellwig <hch@...radead.org>
To: Theodore Ts'o <tytso@....edu>
Cc: Christoph Hellwig <hch@...radead.org>,
Zhang Yi <yi.zhang@...weicloud.com>, linux-fsdevel@...r.kernel.org,
linux-ext4@...r.kernel.org, linux-kernel@...r.kernel.org,
viro@...iv.linux.org.uk, brauner@...nel.org, jack@...e.cz,
djwong@...nel.org, adilger.kernel@...ger.ca, yi.zhang@...wei.com,
chengzhihao1@...wei.com, yukuai3@...wei.com, yangerkun@...wei.com,
Sai Chaitanya Mitta <mittachaitu@...il.com>,
linux-xfs@...r.kernel.org
Subject: Re: [RFC PATCH 1/2] fs: introduce FALLOC_FL_FORCE_ZERO to fallocate
On Mon, Jan 06, 2025 at 11:17:32AM -0500, Theodore Ts'o wrote:
> Yes. And we might decide that it should be done using some kind of
> ioctl, such as BLKDISCARD, as opposed to a new fallocate operation,
> since it really isn't a filesystem metadata operation, just as
> BLKDISARD isn't. The other side of the argument is that ioctls are
> ugly, and maybe all new such operations should be plumbed through via
> fallocate as opposed to adding a new ioctl. I don't have strong
> feelings on this, although I *do* belive that whatever interface we
> use, whether it be fallocate or ioctl, it should be supported by block
> devices and files in a file system, to make life easier for those
> databases that want to support running on a raw block device (for
> full-page advertisements on the back cover of the Businessweek
> magazine) or on files (which is how 99.9% of all real-world users
> actually run enterprise databases. :-)
If you want the operation to work for files it needs to be routed
through the file system as otherwise you can't make it actually
work coherently. While you could add a new ioctl that works on a
file fallocate seems like a much better interface. Supporting it
on a block device is trivial, as it can mostly (or even entirely
depending on the exact definition of the interface) reuse the existing
zero range / punch hole code.
Powered by blists - more mailing lists