Re: vfs_test_lock - should it WARN if F_UNLCK and modified file_lock?

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

 



On 8 Jun 2022, at 9:36, J. Bruce Fields wrote:

> On Wed, Jun 08, 2022 at 09:19:25AM -0400, Benjamin Coddington wrote:
>> NLM sometimes gets burnt by implementations of f_op->lock for F_GETLK
>> modifying the lock structure (swapping out fl_owner) when the return is
>> F_UNLCK.
>>
>> Yes, NLM should be more defensive, but perhaps we should be checking for
>> everyone, as per POSIX "If no lock is found that would prevent this lock
>> from being created, then the structure shall be left unchanged
>> except for
>> the lock type which shall be set to F_UNLCK."
>
> Doesn't seem like changing fl_owner affects fcntl_getlk results in this
> case, so I don't think posix applies?  Though, OK, maybe it violates the
> principle of least surprise for vfs_test_lock to behave differently.

Oh yeah, good point.  fl_owner is just internal.  That's enough of a reason
for me to drop this idea.

Ben




[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