Re: [PATCH] fs: Remove obsolete logic in i_size_read/write

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

 



On Wed, Jul 16, 2025 at 9:12 PM Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote:
>
> On Wed, Jul 16, 2025 at 08:53:04PM +0800, Alex wrote:
> > The logic is used to protect load/store tearing on 32 bit platforms,
> > for example, after i_size_read returned, there is no guarantee that
> > inode->size won't be changed. Therefore, READ/WRITE_ONCE suffice, which
> > is already implied by smp_load_acquire/smp_store_release.
>
> Sorry, what?  The problem is not a _later_ change, it's getting the
> upper and lower 32bit halves from different values.
>
> Before: position is 0xffffffff
> After: position is 0x100000000
> The value that might be returned by your variant: 0x1ffffffff.

I mean the sequence lock here is used to only avoid load/store tearing,
smp_load_acquire/smp_store_release already protects that.





[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