diff options
| author | Benjamin Coddington <bcodding@redhat.com> | 2019-05-20 10:33:07 -0400 |
|---|---|---|
| committer | J. Bruce Fields <bfields@redhat.com> | 2019-05-31 09:43:26 -0400 |
| commit | 141731d15d6eb2fd9aaefbf9b935ce86ae243074 (patch) | |
| tree | 0be05c9f4ff705e38fb718bf9d900231e4115036 | |
| parent | cd6c84d8f0cdc911df435bb075ba22ce3c605b07 (diff) | |
Revert "lockd: Show pid of lockd for remote locks"
This reverts most of commit b8eee0e90f97 ("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: b8eee0e90f97 ("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>
| -rw-r--r-- | fs/lockd/xdr.c | 4 | ||||
| -rw-r--r-- | fs/lockd/xdr4.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/fs/lockd/xdr.c b/fs/lockd/xdr.c index 9846f7e95282..7147e4aebecc 100644 --- a/fs/lockd/xdr.c +++ b/fs/lockd/xdr.c | |||
| @@ -127,7 +127,7 @@ nlm_decode_lock(__be32 *p, struct nlm_lock *lock) | |||
| 127 | 127 | ||
| 128 | locks_init_lock(fl); | 128 | locks_init_lock(fl); |
| 129 | fl->fl_owner = current->files; | 129 | fl->fl_owner = current->files; |
| 130 | fl->fl_pid = current->tgid; | 130 | fl->fl_pid = (pid_t)lock->svid; |
| 131 | fl->fl_flags = FL_POSIX; | 131 | fl->fl_flags = FL_POSIX; |
| 132 | fl->fl_type = F_RDLCK; /* as good as anything else */ | 132 | fl->fl_type = F_RDLCK; /* as good as anything else */ |
| 133 | start = ntohl(*p++); | 133 | start = ntohl(*p++); |
| @@ -269,7 +269,7 @@ nlmsvc_decode_shareargs(struct svc_rqst *rqstp, __be32 *p) | |||
| 269 | memset(lock, 0, sizeof(*lock)); | 269 | memset(lock, 0, sizeof(*lock)); |
| 270 | locks_init_lock(&lock->fl); | 270 | locks_init_lock(&lock->fl); |
| 271 | lock->svid = ~(u32) 0; | 271 | lock->svid = ~(u32) 0; |
| 272 | lock->fl.fl_pid = current->tgid; | 272 | lock->fl.fl_pid = (pid_t)lock->svid; |
| 273 | 273 | ||
| 274 | if (!(p = nlm_decode_cookie(p, &argp->cookie)) | 274 | if (!(p = nlm_decode_cookie(p, &argp->cookie)) |
| 275 | || !(p = xdr_decode_string_inplace(p, &lock->caller, | 275 | || !(p = xdr_decode_string_inplace(p, &lock->caller, |
diff --git a/fs/lockd/xdr4.c b/fs/lockd/xdr4.c index 70154f376695..7ed9edf9aed4 100644 --- a/fs/lockd/xdr4.c +++ b/fs/lockd/xdr4.c | |||
| @@ -119,7 +119,7 @@ nlm4_decode_lock(__be32 *p, struct nlm_lock *lock) | |||
| 119 | 119 | ||
| 120 | locks_init_lock(fl); | 120 | locks_init_lock(fl); |
| 121 | fl->fl_owner = current->files; | 121 | fl->fl_owner = current->files; |
| 122 | fl->fl_pid = current->tgid; | 122 | fl->fl_pid = (pid_t)lock->svid; |
| 123 | fl->fl_flags = FL_POSIX; | 123 | fl->fl_flags = FL_POSIX; |
| 124 | fl->fl_type = F_RDLCK; /* as good as anything else */ | 124 | fl->fl_type = F_RDLCK; /* as good as anything else */ |
| 125 | p = xdr_decode_hyper(p, &start); | 125 | p = xdr_decode_hyper(p, &start); |
| @@ -266,7 +266,7 @@ nlm4svc_decode_shareargs(struct svc_rqst *rqstp, __be32 *p) | |||
| 266 | memset(lock, 0, sizeof(*lock)); | 266 | memset(lock, 0, sizeof(*lock)); |
| 267 | locks_init_lock(&lock->fl); | 267 | locks_init_lock(&lock->fl); |
| 268 | lock->svid = ~(u32) 0; | 268 | lock->svid = ~(u32) 0; |
| 269 | lock->fl.fl_pid = current->tgid; | 269 | lock->fl.fl_pid = (pid_t)lock->svid; |
| 270 | 270 | ||
| 271 | if (!(p = nlm4_decode_cookie(p, &argp->cookie)) | 271 | if (!(p = nlm4_decode_cookie(p, &argp->cookie)) |
| 272 | || !(p = xdr_decode_string_inplace(p, &lock->caller, | 272 | || !(p = xdr_decode_string_inplace(p, &lock->caller, |
