Revert "lockd: Show pid of lockd for remote locks"

This reverts most of commit b8eee0e90f ("lockd: Show pid of lockd for
remote locks"), which caused remote locks to not be differentiated between
remote processes for NLM.

We retain the fixup for setting the client's fl_pid to a negative value.

Fixes: b8eee0e90f ("lockd: Show pid of lockd for remote locks")
Cc: stable@vger.kernel.org

Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Reviewed-by: XueWei Zhang <xueweiz@google.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
This commit is contained in:
Benjamin Coddington 2019-05-20 10:33:07 -04:00 committed by J. Bruce Fields
parent cd6c84d8f0
commit 141731d15d
2 changed files with 4 additions and 4 deletions

View file

@ -127,7 +127,7 @@ nlm_decode_lock(__be32 *p, struct nlm_lock *lock)
locks_init_lock(fl); locks_init_lock(fl);
fl->fl_owner = current->files; fl->fl_owner = current->files;
fl->fl_pid = current->tgid; fl->fl_pid = (pid_t)lock->svid;
fl->fl_flags = FL_POSIX; fl->fl_flags = FL_POSIX;
fl->fl_type = F_RDLCK; /* as good as anything else */ fl->fl_type = F_RDLCK; /* as good as anything else */
start = ntohl(*p++); start = ntohl(*p++);
@ -269,7 +269,7 @@ nlmsvc_decode_shareargs(struct svc_rqst *rqstp, __be32 *p)
memset(lock, 0, sizeof(*lock)); memset(lock, 0, sizeof(*lock));
locks_init_lock(&lock->fl); locks_init_lock(&lock->fl);
lock->svid = ~(u32) 0; lock->svid = ~(u32) 0;
lock->fl.fl_pid = current->tgid; lock->fl.fl_pid = (pid_t)lock->svid;
if (!(p = nlm_decode_cookie(p, &argp->cookie)) if (!(p = nlm_decode_cookie(p, &argp->cookie))
|| !(p = xdr_decode_string_inplace(p, &lock->caller, || !(p = xdr_decode_string_inplace(p, &lock->caller,

View file

@ -119,7 +119,7 @@ nlm4_decode_lock(__be32 *p, struct nlm_lock *lock)
locks_init_lock(fl); locks_init_lock(fl);
fl->fl_owner = current->files; fl->fl_owner = current->files;
fl->fl_pid = current->tgid; fl->fl_pid = (pid_t)lock->svid;
fl->fl_flags = FL_POSIX; fl->fl_flags = FL_POSIX;
fl->fl_type = F_RDLCK; /* as good as anything else */ fl->fl_type = F_RDLCK; /* as good as anything else */
p = xdr_decode_hyper(p, &start); p = xdr_decode_hyper(p, &start);
@ -266,7 +266,7 @@ nlm4svc_decode_shareargs(struct svc_rqst *rqstp, __be32 *p)
memset(lock, 0, sizeof(*lock)); memset(lock, 0, sizeof(*lock));
locks_init_lock(&lock->fl); locks_init_lock(&lock->fl);
lock->svid = ~(u32) 0; lock->svid = ~(u32) 0;
lock->fl.fl_pid = current->tgid; lock->fl.fl_pid = (pid_t)lock->svid;
if (!(p = nlm4_decode_cookie(p, &argp->cookie)) if (!(p = nlm4_decode_cookie(p, &argp->cookie))
|| !(p = xdr_decode_string_inplace(p, &lock->caller, || !(p = xdr_decode_string_inplace(p, &lock->caller,