aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/callback_xdr.c8
-rw-r--r--fs/nfs/delegation.c4
-rw-r--r--fs/nfs/direct.c2
-rw-r--r--fs/nfs/inode.c1
4 files changed, 6 insertions, 9 deletions
diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c
index f4ccfe6521ec..19ca95cdfd9b 100644
--- a/fs/nfs/callback_xdr.c
+++ b/fs/nfs/callback_xdr.c
@@ -313,7 +313,7 @@ __be32 decode_devicenotify_args(struct svc_rqst *rqstp,
313 goto out; 313 goto out;
314 } 314 }
315 315
316 args->devs = kmalloc(n * sizeof(*args->devs), GFP_KERNEL); 316 args->devs = kmalloc_array(n, sizeof(*args->devs), GFP_KERNEL);
317 if (!args->devs) { 317 if (!args->devs) {
318 status = htonl(NFS4ERR_DELAY); 318 status = htonl(NFS4ERR_DELAY);
319 goto out; 319 goto out;
@@ -415,7 +415,7 @@ static __be32 decode_rc_list(struct xdr_stream *xdr,
415 rc_list->rcl_nrefcalls * 2 * sizeof(uint32_t)); 415 rc_list->rcl_nrefcalls * 2 * sizeof(uint32_t));
416 if (unlikely(p == NULL)) 416 if (unlikely(p == NULL))
417 goto out; 417 goto out;
418 rc_list->rcl_refcalls = kmalloc(rc_list->rcl_nrefcalls * 418 rc_list->rcl_refcalls = kmalloc_array(rc_list->rcl_nrefcalls,
419 sizeof(*rc_list->rcl_refcalls), 419 sizeof(*rc_list->rcl_refcalls),
420 GFP_KERNEL); 420 GFP_KERNEL);
421 if (unlikely(rc_list->rcl_refcalls == NULL)) 421 if (unlikely(rc_list->rcl_refcalls == NULL))
@@ -464,8 +464,10 @@ static __be32 decode_cb_sequence_args(struct svc_rqst *rqstp,
464 464
465 for (i = 0; i < args->csa_nrclists; i++) { 465 for (i = 0; i < args->csa_nrclists; i++) {
466 status = decode_rc_list(xdr, &args->csa_rclists[i]); 466 status = decode_rc_list(xdr, &args->csa_rclists[i]);
467 if (status) 467 if (status) {
468 args->csa_nrclists = i;
468 goto out_free; 469 goto out_free;
470 }
469 } 471 }
470 } 472 }
471 status = 0; 473 status = 0;
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c
index da5433230bb1..a1f0685b42ff 100644
--- a/fs/nfs/delegation.c
+++ b/fs/nfs/delegation.c
@@ -180,7 +180,6 @@ void nfs_inode_reclaim_delegation(struct inode *inode, struct rpc_cred *cred,
180 delegation->cred = get_rpccred(cred); 180 delegation->cred = get_rpccred(cred);
181 clear_bit(NFS_DELEGATION_NEED_RECLAIM, 181 clear_bit(NFS_DELEGATION_NEED_RECLAIM,
182 &delegation->flags); 182 &delegation->flags);
183 NFS_I(inode)->delegation_state = delegation->type;
184 spin_unlock(&delegation->lock); 183 spin_unlock(&delegation->lock);
185 put_rpccred(oldcred); 184 put_rpccred(oldcred);
186 rcu_read_unlock(); 185 rcu_read_unlock();
@@ -275,7 +274,6 @@ nfs_detach_delegation_locked(struct nfs_inode *nfsi,
275 set_bit(NFS_DELEGATION_RETURNING, &delegation->flags); 274 set_bit(NFS_DELEGATION_RETURNING, &delegation->flags);
276 list_del_rcu(&delegation->super_list); 275 list_del_rcu(&delegation->super_list);
277 delegation->inode = NULL; 276 delegation->inode = NULL;
278 nfsi->delegation_state = 0;
279 rcu_assign_pointer(nfsi->delegation, NULL); 277 rcu_assign_pointer(nfsi->delegation, NULL);
280 spin_unlock(&delegation->lock); 278 spin_unlock(&delegation->lock);
281 return delegation; 279 return delegation;
@@ -355,7 +353,6 @@ int nfs_inode_set_delegation(struct inode *inode, struct rpc_cred *cred, struct
355 &delegation->stateid)) { 353 &delegation->stateid)) {
356 nfs_update_inplace_delegation(old_delegation, 354 nfs_update_inplace_delegation(old_delegation,
357 delegation); 355 delegation);
358 nfsi->delegation_state = old_delegation->type;
359 goto out; 356 goto out;
360 } 357 }
361 /* 358 /*
@@ -379,7 +376,6 @@ int nfs_inode_set_delegation(struct inode *inode, struct rpc_cred *cred, struct
379 goto out; 376 goto out;
380 } 377 }
381 list_add_rcu(&delegation->super_list, &server->delegations); 378 list_add_rcu(&delegation->super_list, &server->delegations);
382 nfsi->delegation_state = delegation->type;
383 rcu_assign_pointer(nfsi->delegation, delegation); 379 rcu_assign_pointer(nfsi->delegation, delegation);
384 delegation = NULL; 380 delegation = NULL;
385 381
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index 7077521acdf4..e907c8cf732e 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -283,7 +283,7 @@ static void nfs_direct_release_pages(struct page **pages, unsigned int npages)
283void nfs_init_cinfo_from_dreq(struct nfs_commit_info *cinfo, 283void nfs_init_cinfo_from_dreq(struct nfs_commit_info *cinfo,
284 struct nfs_direct_req *dreq) 284 struct nfs_direct_req *dreq)
285{ 285{
286 cinfo->lock = &dreq->lock; 286 cinfo->lock = &dreq->inode->i_lock;
287 cinfo->mds = &dreq->mds_cinfo; 287 cinfo->mds = &dreq->mds_cinfo;
288 cinfo->ds = &dreq->ds_cinfo; 288 cinfo->ds = &dreq->ds_cinfo;
289 cinfo->dreq = dreq; 289 cinfo->dreq = dreq;
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index e4f0dcef8f54..83107be3dd01 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -1775,7 +1775,6 @@ static inline void nfs4_init_once(struct nfs_inode *nfsi)
1775#if IS_ENABLED(CONFIG_NFS_V4) 1775#if IS_ENABLED(CONFIG_NFS_V4)
1776 INIT_LIST_HEAD(&nfsi->open_states); 1776 INIT_LIST_HEAD(&nfsi->open_states);
1777 nfsi->delegation = NULL; 1777 nfsi->delegation = NULL;
1778 nfsi->delegation_state = 0;
1779 init_rwsem(&nfsi->rwsem); 1778 init_rwsem(&nfsi->rwsem);
1780 nfsi->layout = NULL; 1779 nfsi->layout = NULL;
1781#endif 1780#endif