lockd: Show pid of lockd for remote locks
authorBenjamin Coddington <bcodding@redhat.com>
Thu, 1 Nov 2018 17:39:49 +0000 (13:39 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Jan 2019 09:01:06 +0000 (10:01 +0100)
commit01b79d20008d26d9e908551bd32f01ed0cbf6f53
tree4b5f88a9295b8bdcffeb9414b9747022630e5cd6
parent2524f5d6f4603e6dece56ea62c09ced0d6a635b9
lockd: Show pid of lockd for remote locks

commit b8eee0e90f9797b747113638bc75e739b192ad38 upstream.

Commit 9d5b86ac13c5 ("fs/locks: Remove fl_nspid and use fs-specific l_pid
for remote locks") specified that the l_pid returned for F_GETLK on a local
file that has a remote lock should be the pid of the lock manager process.
That commit, while updating other filesystems, failed to update lockd, such
that locks created by lockd had their fl_pid set to that of the remote
process holding the lock.  Fix that here to be the pid of lockd.

Also, fix the client case so that the returned lock pid is negative, which
indicates a remote lock on a remote file.

Fixes: 9d5b86ac13c5 ("fs/locks: Remove fl_nspid and use fs-specific...")
Cc: stable@vger.kernel.org
Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/lockd/clntproc.c
fs/lockd/xdr.c
fs/lockd/xdr4.c