Re: [PATCH 3/6] fs: Split fcntl_rw_hint()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1/31/24 13:07, Dave Chinner wrote:
On Wed, Jan 31, 2024 at 12:52:34PM -0800, Bart Van Assche wrote:
+	inode_lock(inode);
+	inode->i_write_hint = hint;
+	inode_unlock(inode);

What is this locking serialising against? The inode may or may not
be locked when we access this in IO path, so why isn't this just
WRITE_ONCE() here and READ_ONCE() in the IO paths?

How about using WRITE_ONCE()/READ_ONCE() in the fcntl implementations and
regular reads in the I/O paths? Using F_SET_RW_HINT while I/O is ongoing
is racy - there are no guarantees about how F_SET_RW_HINT will affect I/O
that has already been submitted. Hence, I think that it is acceptable to
use regular reads for i_write_hint in the I/O paths.

Thanks,

Bart.





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux