From: Christoph Hellwig <hch@infradead.org>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: Christoph Hellwig <hch@infradead.org>,
Lukas Herbolt <lukas@herbolt.com>,
linux-xfs@vger.kernel.org
Subject: Re: [PATCH RFC] xfs: add FALLOC_FL_WRITE_ZEROES to XFS code base
Date: Fri, 3 Oct 2025 21:16:58 -0700 [thread overview]
Message-ID: <aOCfus7PgLl812qf@infradead.org> (raw)
In-Reply-To: <20251004040020.GC8096@frogsfrogsfrogs>
On Fri, Oct 03, 2025 at 09:00:20PM -0700, Darrick J. Wong wrote:
> > > - error = xfs_alloc_file_space(XFS_I(inode), offset, len);
> > > + if (mode & FALLOC_FL_WRITE_ZEROES) {
> > > + if (!bdev_write_zeroes_unmap_sectors(inode->i_sb->s_bdev))
>
> not correct ^^^^^^^^^^^^^^^^^^^
>
> You need to find the block device associated with the file because XFS
> is a multi-device filesystem.
Indeed. xfs_inode_buftarg will do the work, but we'll need to ensure
the RT bit doesn't get flipped, i.e. it needs to hold a lock between
that check and allocation the blocks if there were none yet.
next prev parent reply other threads:[~2025-10-04 4:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-02 12:28 [PATCH RFC] xfs: add FALLOC_FL_WRITE_ZEROES to XFS code base Lukas Herbolt
2025-10-03 7:51 ` Christoph Hellwig
2025-10-04 4:00 ` Darrick J. Wong
2025-10-04 4:16 ` Christoph Hellwig [this message]
2025-10-14 8:10 ` lukas
2025-10-14 21:15 ` Darrick J. Wong
2025-10-15 6:30 ` Nirjhar Roy (IBM)
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=aOCfus7PgLl812qf@infradead.org \
--to=hch@infradead.org \
--cc=djwong@kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=lukas@herbolt.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).