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.