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.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index f30cc4eadb0a..ebf56c6040ca 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -1026,7 +1026,7 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
1026 if (host_err >= 0 && (inode->i_mode & (S_ISUID | S_ISGID))) 1026 if (host_err >= 0 && (inode->i_mode & (S_ISUID | S_ISGID)))
1027 kill_suid(dentry); 1027 kill_suid(dentry);
1028 1028
1029 if (host_err >= 0 && stable) { 1029 if (host_err >= 0 && stable && use_wgather) {
1030 static ino_t last_ino; 1030 static ino_t last_ino;
1031 static dev_t last_dev; 1031 static dev_t last_dev;
1032 1032
@@ -1042,21 +1042,16 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
1042 * nice and simple solution (IMHO), and it seems to 1042 * nice and simple solution (IMHO), and it seems to
1043 * work:-) 1043 * work:-)
1044 */ 1044 */
1045 if (use_wgather) { 1045 if (atomic_read(&inode->i_writecount) > 1
1046 if (atomic_read(&inode->i_writecount) > 1 1046 || (last_ino == inode->i_ino && last_dev == inode->i_sb->s_dev)) {
1047 || (last_ino == inode->i_ino && last_dev == inode->i_sb->s_dev)) { 1047 dprintk("nfsd: write defer %d\n", task_pid_nr(current));
1048 dprintk("nfsd: write defer %d\n", task_pid_nr(current)); 1048 msleep(10);
1049 msleep(10); 1049 dprintk("nfsd: write resume %d\n", task_pid_nr(current));
1050 dprintk("nfsd: write resume %d\n", task_pid_nr(current)); 1050 }
1051 }
1052 1051
1053 if (inode->i_state & I_DIRTY) { 1052 if (inode->i_state & I_DIRTY) {
1054 dprintk("nfsd: write sync %d\n", task_pid_nr(current)); 1053 dprintk("nfsd: write sync %d\n", task_pid_nr(current));
1055 host_err=nfsd_sync(file); 1054 host_err=nfsd_sync(file);
1056 }
1057#if 0
1058 wake_up(&inode->i_wait);
1059#endif
1060 } 1055 }
1061 last_ino = inode->i_ino; 1056 last_ino = inode->i_ino;
1062 last_dev = inode->i_sb->s_dev; 1057 last_dev = inode->i_sb->s_dev;