diff options
-rw-r--r-- | fs/nfs/direct.c | 2 | ||||
-rw-r--r-- | fs/nfs/idmap.c | 2 | ||||
-rw-r--r-- | fs/nfs/nfs4proc.c | 4 | ||||
-rw-r--r-- | fs/nfs/pagelist.c | 8 |
4 files changed, 11 insertions, 5 deletions
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index 064a80961677..84d3c8b90206 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c | |||
@@ -873,7 +873,7 @@ static ssize_t nfs_direct_write(struct kiocb *iocb, const struct iovec *iov, | |||
873 | dreq->inode = inode; | 873 | dreq->inode = inode; |
874 | dreq->ctx = get_nfs_open_context(nfs_file_open_context(iocb->ki_filp)); | 874 | dreq->ctx = get_nfs_open_context(nfs_file_open_context(iocb->ki_filp)); |
875 | dreq->l_ctx = nfs_get_lock_context(dreq->ctx); | 875 | dreq->l_ctx = nfs_get_lock_context(dreq->ctx); |
876 | if (dreq->l_ctx != NULL) | 876 | if (dreq->l_ctx == NULL) |
877 | goto out_release; | 877 | goto out_release; |
878 | if (!is_sync_kiocb(iocb)) | 878 | if (!is_sync_kiocb(iocb)) |
879 | dreq->iocb = iocb; | 879 | dreq->iocb = iocb; |
diff --git a/fs/nfs/idmap.c b/fs/nfs/idmap.c index dec47ed8b6b9..4e2d9b6b1380 100644 --- a/fs/nfs/idmap.c +++ b/fs/nfs/idmap.c | |||
@@ -123,7 +123,7 @@ static ssize_t nfs_idmap_get_desc(const char *name, size_t namelen, | |||
123 | size_t desclen = typelen + namelen + 2; | 123 | size_t desclen = typelen + namelen + 2; |
124 | 124 | ||
125 | *desc = kmalloc(desclen, GFP_KERNEL); | 125 | *desc = kmalloc(desclen, GFP_KERNEL); |
126 | if (!desc) | 126 | if (!*desc) |
127 | return -ENOMEM; | 127 | return -ENOMEM; |
128 | 128 | ||
129 | cp = *desc; | 129 | cp = *desc; |
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 32c8758c99fd..0f24cdf2cb13 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -429,7 +429,7 @@ static int nfs41_sequence_done(struct rpc_task *task, struct nfs4_sequence_res * | |||
429 | * returned NFS4ERR_DELAY as per Section 2.10.6.2 | 429 | * returned NFS4ERR_DELAY as per Section 2.10.6.2 |
430 | * of RFC5661. | 430 | * of RFC5661. |
431 | */ | 431 | */ |
432 | dprintk("%s: slot=%ld seq=%d: Operation in progress\n", | 432 | dprintk("%s: slot=%td seq=%d: Operation in progress\n", |
433 | __func__, | 433 | __func__, |
434 | res->sr_slot - res->sr_session->fc_slot_table.slots, | 434 | res->sr_slot - res->sr_session->fc_slot_table.slots, |
435 | res->sr_slot->seq_nr); | 435 | res->sr_slot->seq_nr); |
@@ -573,7 +573,7 @@ int nfs4_setup_sequence(const struct nfs_server *server, | |||
573 | goto out; | 573 | goto out; |
574 | } | 574 | } |
575 | 575 | ||
576 | dprintk("--> %s clp %p session %p sr_slot %ld\n", | 576 | dprintk("--> %s clp %p session %p sr_slot %td\n", |
577 | __func__, session->clp, session, res->sr_slot ? | 577 | __func__, session->clp, session, res->sr_slot ? |
578 | res->sr_slot - session->fc_slot_table.slots : -1); | 578 | res->sr_slot - session->fc_slot_table.slots : -1); |
579 | 579 | ||
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c index 919490232e17..137b549e63db 100644 --- a/fs/nfs/pagelist.c +++ b/fs/nfs/pagelist.c | |||
@@ -65,6 +65,13 @@ nfs_create_request(struct nfs_open_context *ctx, struct inode *inode, | |||
65 | if (req == NULL) | 65 | if (req == NULL) |
66 | return ERR_PTR(-ENOMEM); | 66 | return ERR_PTR(-ENOMEM); |
67 | 67 | ||
68 | /* get lock context early so we can deal with alloc failures */ | ||
69 | req->wb_lock_context = nfs_get_lock_context(ctx); | ||
70 | if (req->wb_lock_context == NULL) { | ||
71 | nfs_page_free(req); | ||
72 | return ERR_PTR(-ENOMEM); | ||
73 | } | ||
74 | |||
68 | /* Initialize the request struct. Initially, we assume a | 75 | /* Initialize the request struct. Initially, we assume a |
69 | * long write-back delay. This will be adjusted in | 76 | * long write-back delay. This will be adjusted in |
70 | * update_nfs_request below if the region is not locked. */ | 77 | * update_nfs_request below if the region is not locked. */ |
@@ -79,7 +86,6 @@ nfs_create_request(struct nfs_open_context *ctx, struct inode *inode, | |||
79 | req->wb_pgbase = offset; | 86 | req->wb_pgbase = offset; |
80 | req->wb_bytes = count; | 87 | req->wb_bytes = count; |
81 | req->wb_context = get_nfs_open_context(ctx); | 88 | req->wb_context = get_nfs_open_context(ctx); |
82 | req->wb_lock_context = nfs_get_lock_context(ctx); | ||
83 | kref_init(&req->wb_kref); | 89 | kref_init(&req->wb_kref); |
84 | return req; | 90 | return req; |
85 | } | 91 | } |