]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.14.124/revert-lockd-show-pid-of-lockd-for-remote-locks.patch
Linux 4.14.124
[thirdparty/kernel/stable-queue.git] / releases / 4.14.124 / revert-lockd-show-pid-of-lockd-for-remote-locks.patch
CommitLineData
712e71df
GKH
1From 141731d15d6eb2fd9aaefbf9b935ce86ae243074 Mon Sep 17 00:00:00 2001
2From: Benjamin Coddington <bcodding@redhat.com>
3Date: Mon, 20 May 2019 10:33:07 -0400
4Subject: Revert "lockd: Show pid of lockd for remote locks"
5
6From: Benjamin Coddington <bcodding@redhat.com>
7
8commit 141731d15d6eb2fd9aaefbf9b935ce86ae243074 upstream.
9
10This reverts most of commit b8eee0e90f97 ("lockd: Show pid of lockd for
11remote locks"), which caused remote locks to not be differentiated between
12remote processes for NLM.
13
14We retain the fixup for setting the client's fl_pid to a negative value.
15
16Fixes: b8eee0e90f97 ("lockd: Show pid of lockd for remote locks")
17Cc: stable@vger.kernel.org
18
19Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
20Reviewed-by: XueWei Zhang <xueweiz@google.com>
21Signed-off-by: J. Bruce Fields <bfields@redhat.com>
22Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
23
24---
25 fs/lockd/xdr.c | 4 ++--
26 fs/lockd/xdr4.c | 4 ++--
27 2 files changed, 4 insertions(+), 4 deletions(-)
28
29--- a/fs/lockd/xdr.c
30+++ b/fs/lockd/xdr.c
31@@ -127,7 +127,7 @@ nlm_decode_lock(__be32 *p, struct nlm_lo
32
33 locks_init_lock(fl);
34 fl->fl_owner = current->files;
35- fl->fl_pid = current->tgid;
36+ fl->fl_pid = (pid_t)lock->svid;
37 fl->fl_flags = FL_POSIX;
38 fl->fl_type = F_RDLCK; /* as good as anything else */
39 start = ntohl(*p++);
40@@ -269,7 +269,7 @@ nlmsvc_decode_shareargs(struct svc_rqst
41 memset(lock, 0, sizeof(*lock));
42 locks_init_lock(&lock->fl);
43 lock->svid = ~(u32) 0;
44- lock->fl.fl_pid = current->tgid;
45+ lock->fl.fl_pid = (pid_t)lock->svid;
46
47 if (!(p = nlm_decode_cookie(p, &argp->cookie))
48 || !(p = xdr_decode_string_inplace(p, &lock->caller,
49--- a/fs/lockd/xdr4.c
50+++ b/fs/lockd/xdr4.c
51@@ -119,7 +119,7 @@ nlm4_decode_lock(__be32 *p, struct nlm_l
52
53 locks_init_lock(fl);
54 fl->fl_owner = current->files;
55- fl->fl_pid = current->tgid;
56+ fl->fl_pid = (pid_t)lock->svid;
57 fl->fl_flags = FL_POSIX;
58 fl->fl_type = F_RDLCK; /* as good as anything else */
59 p = xdr_decode_hyper(p, &start);
60@@ -266,7 +266,7 @@ nlm4svc_decode_shareargs(struct svc_rqst
61 memset(lock, 0, sizeof(*lock));
62 locks_init_lock(&lock->fl);
63 lock->svid = ~(u32) 0;
64- lock->fl.fl_pid = current->tgid;
65+ lock->fl.fl_pid = (pid_t)lock->svid;
66
67 if (!(p = nlm4_decode_cookie(p, &argp->cookie))
68 || !(p = xdr_decode_string_inplace(p, &lock->caller,