Re: [PATCH 2/2] fs/locks: Remove fl_nspid and use fs-specific l_pid for remote locks

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

 



On 20 Jun 2017, at 13:06, Jeff Layton wrote:
>
> Now that I think about it a bit more, I don't think we really need a
> flag here.
>
> Just have the ->lock operation set the fl_pid to a negative value. That
> will never be a valid pid anyway. Then flock_translate_pid could just
> return any negative value directly instead of trying to translate it.
>
> In practice we would always just set it to -1. Maybe even add something
> like this that the lock-> operation could set it to?
>
> #define    FILE_LOCK_OWNER_UNDEFINED       -1

So for filesystems that set a remote pid, they should negate the pid to mean
that the pid should not be translated?  Then when we return that pid, we
flip it back again, or display a negative number, or turn it into -1?

The flag, having a readable name, would make things a bit clearer as to what
the filesystems expect to happen to that pid value.

Ben



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