diff options
Diffstat (limited to 'fs/nfsd/vfs.c')
-rw-r--r-- | fs/nfsd/vfs.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 6dd5f1970e01..ebbf3b6b2457 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c | |||
@@ -724,7 +724,7 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, | |||
724 | struct inode *inode; | 724 | struct inode *inode; |
725 | int flags = O_RDONLY|O_LARGEFILE; | 725 | int flags = O_RDONLY|O_LARGEFILE; |
726 | __be32 err; | 726 | __be32 err; |
727 | int host_err; | 727 | int host_err = 0; |
728 | 728 | ||
729 | validate_process_creds(); | 729 | validate_process_creds(); |
730 | 730 | ||
@@ -761,7 +761,8 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, | |||
761 | * Check to see if there are any leases on this file. | 761 | * Check to see if there are any leases on this file. |
762 | * This may block while leases are broken. | 762 | * This may block while leases are broken. |
763 | */ | 763 | */ |
764 | host_err = break_lease(inode, O_NONBLOCK | ((access & NFSD_MAY_WRITE) ? O_WRONLY : 0)); | 764 | if (!(access & NFSD_MAY_NOT_BREAK_LEASE)) |
765 | host_err = break_lease(inode, O_NONBLOCK | ((access & NFSD_MAY_WRITE) ? O_WRONLY : 0)); | ||
765 | if (host_err == -EWOULDBLOCK) | 766 | if (host_err == -EWOULDBLOCK) |
766 | host_err = -ETIMEDOUT; | 767 | host_err = -ETIMEDOUT; |
767 | if (host_err) /* NOMEM or WOULDBLOCK */ | 768 | if (host_err) /* NOMEM or WOULDBLOCK */ |
@@ -998,7 +999,7 @@ static int wait_for_concurrent_writes(struct file *file) | |||
998 | 999 | ||
999 | if (inode->i_state & I_DIRTY) { | 1000 | if (inode->i_state & I_DIRTY) { |
1000 | dprintk("nfsd: write sync %d\n", task_pid_nr(current)); | 1001 | dprintk("nfsd: write sync %d\n", task_pid_nr(current)); |
1001 | err = vfs_fsync(file, file->f_path.dentry, 0); | 1002 | err = vfs_fsync(file, 0); |
1002 | } | 1003 | } |
1003 | last_ino = inode->i_ino; | 1004 | last_ino = inode->i_ino; |
1004 | last_dev = inode->i_sb->s_dev; | 1005 | last_dev = inode->i_sb->s_dev; |
@@ -1169,12 +1170,12 @@ nfsd_commit(struct svc_rqst *rqstp, struct svc_fh *fhp, | |||
1169 | goto out; | 1170 | goto out; |
1170 | } | 1171 | } |
1171 | 1172 | ||
1172 | err = nfsd_open(rqstp, fhp, S_IFREG, NFSD_MAY_WRITE, &file); | 1173 | err = nfsd_open(rqstp, fhp, S_IFREG, |
1174 | NFSD_MAY_WRITE|NFSD_MAY_NOT_BREAK_LEASE, &file); | ||
1173 | if (err) | 1175 | if (err) |
1174 | goto out; | 1176 | goto out; |
1175 | if (EX_ISSYNC(fhp->fh_export)) { | 1177 | if (EX_ISSYNC(fhp->fh_export)) { |
1176 | int err2 = vfs_fsync_range(file, file->f_path.dentry, | 1178 | int err2 = vfs_fsync_range(file, offset, end, 0); |
1177 | offset, end, 0); | ||
1178 | 1179 | ||
1179 | if (err2 != -EINVAL) | 1180 | if (err2 != -EINVAL) |
1180 | err = nfserrno(err2); | 1181 | err = nfserrno(err2); |