aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/nfsd/vfs.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 0a01e2fc5dda..f97d4356431b 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -374,14 +374,6 @@ nfsd_setattr(struct svc_rqst *rqstp, struct svc_fh *fhp, struct iattr *iap,
374 goto out; 374 goto out;
375 } 375 }
376 376
377 /*
378 * If we are changing the size of the file, then
379 * we need to break all leases.
380 */
381 host_err = break_lease(inode, O_WRONLY | O_NONBLOCK);
382 if (host_err) /* ENOMEM or EWOULDBLOCK */
383 goto out_nfserr;
384
385 host_err = get_write_access(inode); 377 host_err = get_write_access(inode);
386 if (host_err) 378 if (host_err)
387 goto out_nfserr; 379 goto out_nfserr;
@@ -422,7 +414,11 @@ nfsd_setattr(struct svc_rqst *rqstp, struct svc_fh *fhp, struct iattr *iap,
422 414
423 err = nfserr_notsync; 415 err = nfserr_notsync;
424 if (!check_guard || guardtime == inode->i_ctime.tv_sec) { 416 if (!check_guard || guardtime == inode->i_ctime.tv_sec) {
417 host_err = break_lease(inode, O_WRONLY | O_NONBLOCK);
418 if (host_err)
419 goto out_nfserr;
425 fh_lock(fhp); 420 fh_lock(fhp);
421
426 host_err = notify_change(dentry, iap); 422 host_err = notify_change(dentry, iap);
427 err = nfserrno(host_err); 423 err = nfserrno(host_err);
428 fh_unlock(fhp); 424 fh_unlock(fhp);