diff options
author | Benjamin Coddington <bcodding@redhat.com> | 2017-09-22 07:57:10 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2017-10-01 18:51:30 -0400 |
commit | 68ebf8fe3bce8c167cf83fbd681c1eb1ed419c6c (patch) | |
tree | a072af2954f775be39270f672ad956d0d0b35444 /fs/nfs/client.c | |
parent | cdb2e53fd6dc715c5b45d0967fcb6dc574cb28f8 (diff) |
NFS: Fix uninitialized rpc_wait_queue
Michael Sterrett reports a NULL pointer dereference on NFSv3 mounts when
CONFIG_NFS_V4 is not set because the NFS UOC rpc_wait_queue has not been
initialized. Move the initialization of the queue out of the CONFIG_NFS_V4
conditional setion.
Fixes: 7d6ddf88c4db ("NFS: Add an iocounter wait function for async RPC tasks")
Cc: stable@vger.kernel.org # 4.11+
Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/client.c')
-rw-r--r-- | fs/nfs/client.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c index efebe6cf4378..22880ef6d8dd 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c | |||
@@ -218,7 +218,6 @@ static void nfs_cb_idr_remove_locked(struct nfs_client *clp) | |||
218 | static void pnfs_init_server(struct nfs_server *server) | 218 | static void pnfs_init_server(struct nfs_server *server) |
219 | { | 219 | { |
220 | rpc_init_wait_queue(&server->roc_rpcwaitq, "pNFS ROC"); | 220 | rpc_init_wait_queue(&server->roc_rpcwaitq, "pNFS ROC"); |
221 | rpc_init_wait_queue(&server->uoc_rpcwaitq, "NFS UOC"); | ||
222 | } | 221 | } |
223 | 222 | ||
224 | #else | 223 | #else |
@@ -888,6 +887,7 @@ struct nfs_server *nfs_alloc_server(void) | |||
888 | ida_init(&server->openowner_id); | 887 | ida_init(&server->openowner_id); |
889 | ida_init(&server->lockowner_id); | 888 | ida_init(&server->lockowner_id); |
890 | pnfs_init_server(server); | 889 | pnfs_init_server(server); |
890 | rpc_init_wait_queue(&server->uoc_rpcwaitq, "NFS UOC"); | ||
891 | 891 | ||
892 | return server; | 892 | return server; |
893 | } | 893 | } |