Skip to content

Commit 68ebe3c

Browse files
committed
Merge tag 'nfs-for-4.14-3' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
Pull NFS client bugfixes from Trond Myklebust: "Hightlights include: stable fixes: - nfs/filelayout: fix oops when freeing filelayout segment - NFS: Fix uninitialized rpc_wait_queue bugfixes: - NFSv4/pnfs: Fix an infinite layoutget loop - nfs: RPC_MAX_AUTH_SIZE is in bytes" * tag 'nfs-for-4.14-3' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: NFSv4/pnfs: Fix an infinite layoutget loop nfs/filelayout: fix oops when freeing filelayout segment sunrpc: remove redundant initialization of sock NFS: Fix uninitialized rpc_wait_queue NFS: Cleanup error handling in nfs_idmap_request_key() nfs: RPC_MAX_AUTH_SIZE is in bytes
2 parents 8a5776a + e8fa33a commit 68ebe3c

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

fs/nfs/client.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ static void nfs_cb_idr_remove_locked(struct nfs_client *clp)
218218
static void pnfs_init_server(struct nfs_server *server)
219219
{
220220
rpc_init_wait_queue(&server->roc_rpcwaitq, "pNFS ROC");
221-
rpc_init_wait_queue(&server->uoc_rpcwaitq, "NFS UOC");
222221
}
223222

224223
#else
@@ -888,6 +887,7 @@ struct nfs_server *nfs_alloc_server(void)
888887
ida_init(&server->openowner_id);
889888
ida_init(&server->lockowner_id);
890889
pnfs_init_server(server);
890+
rpc_init_wait_queue(&server->uoc_rpcwaitq, "NFS UOC");
891891

892892
return server;
893893
}

fs/nfs/filelayout/filelayout.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,8 @@ filelayout_free_lseg(struct pnfs_layout_segment *lseg)
745745
struct nfs4_filelayout_segment *fl = FILELAYOUT_LSEG(lseg);
746746

747747
dprintk("--> %s\n", __func__);
748-
nfs4_fl_put_deviceid(fl->dsaddr);
748+
if (fl->dsaddr != NULL)
749+
nfs4_fl_put_deviceid(fl->dsaddr);
749750
/* This assumes a single RW lseg */
750751
if (lseg->pls_range.iomode == IOMODE_RW) {
751752
struct nfs4_filelayout *flo;

fs/nfs/nfs4idmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ static struct key *nfs_idmap_request_key(const char *name, size_t namelen,
274274
ssize_t ret;
275275

276276
ret = nfs_idmap_get_desc(name, namelen, type, strlen(type), &desc);
277-
if (ret <= 0)
277+
if (ret < 0)
278278
return ERR_PTR(ret);
279279

280280
rkey = request_key(&key_type_id_resolver, desc, "");

fs/nfs/nfs4proc.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8399,8 +8399,7 @@ nfs4_layoutget_handle_exception(struct rpc_task *task,
83998399
lo = NFS_I(inode)->layout;
84008400
/* If the open stateid was bad, then recover it. */
84018401
if (!lo || test_bit(NFS_LAYOUT_INVALID_STID, &lo->plh_flags) ||
8402-
nfs4_stateid_match_other(&lgp->args.stateid,
8403-
&lgp->args.ctx->state->stateid)) {
8402+
!nfs4_stateid_match_other(&lgp->args.stateid, &lo->plh_stateid)) {
84048403
spin_unlock(&inode->i_lock);
84058404
exception->state = lgp->args.ctx->state;
84068405
exception->stateid = &lgp->args.stateid;

fs/nfs/nfs4xdr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1842,8 +1842,8 @@ static void encode_create_session(struct xdr_stream *xdr,
18421842
* Assumes OPEN is the biggest non-idempotent compound.
18431843
* 2 is the verifier.
18441844
*/
1845-
max_resp_sz_cached = (NFS4_dec_open_sz + RPC_REPHDRSIZE +
1846-
RPC_MAX_AUTH_SIZE + 2) * XDR_UNIT;
1845+
max_resp_sz_cached = (NFS4_dec_open_sz + RPC_REPHDRSIZE + 2)
1846+
* XDR_UNIT + RPC_MAX_AUTH_SIZE;
18471847

18481848
encode_op_hdr(xdr, OP_CREATE_SESSION, decode_create_session_maxsz, hdr);
18491849
p = reserve_space(xdr, 16 + 2*28 + 20 + clnt->cl_nodelen + 12);

net/sunrpc/xprtsock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2203,7 +2203,7 @@ static void xs_udp_setup_socket(struct work_struct *work)
22032203
struct sock_xprt *transport =
22042204
container_of(work, struct sock_xprt, connect_worker.work);
22052205
struct rpc_xprt *xprt = &transport->xprt;
2206-
struct socket *sock = transport->sock;
2206+
struct socket *sock;
22072207
int status = -EIO;
22082208

22092209
sock = xs_create_sock(xprt, transport,

0 commit comments

Comments
 (0)