aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/vfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfsd/vfs.c')
-rw-r--r--fs/nfsd/vfs.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index a11b0e8678ee..c2dcb4c2b1fc 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -723,7 +723,7 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, int type,
723 struct inode *inode; 723 struct inode *inode;
724 int flags = O_RDONLY|O_LARGEFILE; 724 int flags = O_RDONLY|O_LARGEFILE;
725 __be32 err; 725 __be32 err;
726 int host_err; 726 int host_err = 0;
727 727
728 validate_process_creds(); 728 validate_process_creds();
729 729
@@ -760,7 +760,8 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, int type,
760 * Check to see if there are any leases on this file. 760 * Check to see if there are any leases on this file.
761 * This may block while leases are broken. 761 * This may block while leases are broken.
762 */ 762 */
763 host_err = break_lease(inode, O_NONBLOCK | ((access & NFSD_MAY_WRITE) ? O_WRONLY : 0)); 763 if (!(access & NFSD_MAY_NOT_BREAK_LEASE))
764 host_err = break_lease(inode, O_NONBLOCK | ((access & NFSD_MAY_WRITE) ? O_WRONLY : 0));
764 if (host_err == -EWOULDBLOCK) 765 if (host_err == -EWOULDBLOCK)
765 host_err = -ETIMEDOUT; 766 host_err = -ETIMEDOUT;
766 if (host_err) /* NOMEM or WOULDBLOCK */ 767 if (host_err) /* NOMEM or WOULDBLOCK */
@@ -1168,7 +1169,8 @@ nfsd_commit(struct svc_rqst *rqstp, struct svc_fh *fhp,
1168 goto out; 1169 goto out;
1169 } 1170 }
1170 1171
1171 err = nfsd_open(rqstp, fhp, S_IFREG, NFSD_MAY_WRITE, &file); 1172 err = nfsd_open(rqstp, fhp, S_IFREG,
1173 NFSD_MAY_WRITE|NFSD_MAY_NOT_BREAK_LEASE, &file);
1172 if (err) 1174 if (err)
1173 goto out; 1175 goto out;
1174 if (EX_ISSYNC(fhp->fh_export)) { 1176 if (EX_ISSYNC(fhp->fh_export)) {