lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260119071038.GC1480@lst.de>
Date: Mon, 19 Jan 2026 08:10:38 +0100
From: Christoph Hellwig <hch@....de>
To: Namjae Jeon <linkinjeon@...nel.org>
Cc: Christoph Hellwig <hch@....de>, viro@...iv.linux.org.uk,
	brauner@...nel.org, tytso@....edu, willy@...radead.org,
	jack@...e.cz, djwong@...nel.org, josef@...icpanda.com,
	sandeen@...deen.net, rgoldwyn@...e.com, xiang@...nel.org,
	dsterba@...e.com, pali@...nel.org, ebiggers@...nel.org,
	neil@...wn.name, amir73il@...il.com, linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org, iamjoonsoo.kim@....com,
	cheol.lee@....com, jay.sim@....com, gunho.lee@....com,
	Hyunchul Lee <hyc.lee@...il.com>
Subject: Re: [PATCH v5 06/14] ntfs: update file operations

On Sun, Jan 18, 2026 at 01:56:55PM +0900, Namjae Jeon wrote:
> > Talking about helpers, why does iomap_seek_hole/iomap_seek_data
> > not work for ntfs?
>
> Regarding iomap_seek_hole/iomap_seek_data, the default iomap
> implementation treats IOMAP_UNWRITTEN extents as holes unless they
> have dirty pages in the page cache. However, in ntfs iomap begin, the
> region between initialized_size and i_size (EOF) is mapped as
> IOMAP_UNWRITTEN. Since NTFS requires any pre-allocated regions before
> initialized_size to be physically zeroed, NTFS must treat all
> pre-allocated regions as DATA.

What do you need IOMAP_UNWRITTEN for in that case?  If the blocks have
been zeroed on-disk, they are IOMAP_MAPPED by the usual iomap standards.
If you need special treatement, it might be worth adding a separate
IOMAP_PREZEROED with clearly defined semantics instead of overloading
IOMAP_UNWRITTEN.

> 
> >
> > > +             file_accessed(iocb->ki_filp);
> > > +             ret = iomap_dio_rw(iocb, to, &ntfs_read_iomap_ops, NULL, IOMAP_DIO_PARTIAL,
> >
> > Why do you need IOMAP_DIO_PARTIAL?  That's mostly a workaround
> > for "interesting" locking in btrfs and gfs2.  If ntfs has similar
> > issues, it would be helpful to add a comment here.  Also maybe fix
> > the overly long line.
> Regarding the use of IOMAP_DIO_PARTIAL, I was not aware that it was a
> workaround for specific locking issues in some filesystems. I
> incorrectly assumed it was a flag to enable partial success when a DIO
> request exceeds the actual data length. I will remove this flags and
> fix it.

It only does short I/O for -EFAULT, which only happens if the nofault
flag on the iov_iter is set.  See the big comment in
btrfs_direct_write where that field is set about the explanation.

> > What is the reason to do the expansion here instead of in the iomap_begin
> > handler when we know we are committed to write to range?
> We can probably move it to iomap_begin(). Let me check it.

If it works better here that's also fine, just document it as it looks
a bit unusual.  Handling the cleanup on failures might be a bit easier
if it is done in the iomap loop, though.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ