aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-12-20 12:35:05 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-12-20 12:35:05 -0500
commitfc7e13104f823d1ea9c1f4dd7531c14b0c1e6e7e (patch)
tree489070a6f39a062c7f51cab3cb4c976810eb7556
parent33c37c06f8066342764bd1568c9f3524efe889a5 (diff)
parent9b5b1f5bf9dcdb6f23abf65977a675eb4deba3c0 (diff)
Merge branch 'fixes' of git://git.linux-nfs.org/pub/linux/nfs-2.6
-rw-r--r--fs/lockd/clntlock.c4
-rw-r--r--fs/nfs/direct.c24
-rw-r--r--fs/nfs/file.c23
-rw-r--r--fs/nfs/inode.c28
-rw-r--r--include/linux/nfs_fs.h1
-rw-r--r--net/sunrpc/auth_gss/auth_gss.c6
-rw-r--r--net/sunrpc/rpc_pipe.c4
-rw-r--r--net/sunrpc/xprtsock.c2
8 files changed, 46 insertions, 46 deletions
diff --git a/fs/lockd/clntlock.c b/fs/lockd/clntlock.c
index 006bb9e14579..3eaf6e701087 100644
--- a/fs/lockd/clntlock.c
+++ b/fs/lockd/clntlock.c
@@ -157,6 +157,8 @@ void nlmclnt_mark_reclaim(struct nlm_host *host)
157 inode = fl->fl_file->f_dentry->d_inode; 157 inode = fl->fl_file->f_dentry->d_inode;
158 if (inode->i_sb->s_magic != NFS_SUPER_MAGIC) 158 if (inode->i_sb->s_magic != NFS_SUPER_MAGIC)
159 continue; 159 continue;
160 if (fl->fl_u.nfs_fl.owner == NULL)
161 continue;
160 if (fl->fl_u.nfs_fl.owner->host != host) 162 if (fl->fl_u.nfs_fl.owner->host != host)
161 continue; 163 continue;
162 if (!(fl->fl_u.nfs_fl.flags & NFS_LCK_GRANTED)) 164 if (!(fl->fl_u.nfs_fl.flags & NFS_LCK_GRANTED))
@@ -226,6 +228,8 @@ restart:
226 inode = fl->fl_file->f_dentry->d_inode; 228 inode = fl->fl_file->f_dentry->d_inode;
227 if (inode->i_sb->s_magic != NFS_SUPER_MAGIC) 229 if (inode->i_sb->s_magic != NFS_SUPER_MAGIC)
228 continue; 230 continue;
231 if (fl->fl_u.nfs_fl.owner == NULL)
232 continue;
229 if (fl->fl_u.nfs_fl.owner->host != host) 233 if (fl->fl_u.nfs_fl.owner->host != host)
230 continue; 234 continue;
231 if (!(fl->fl_u.nfs_fl.flags & NFS_LCK_RECLAIM)) 235 if (!(fl->fl_u.nfs_fl.flags & NFS_LCK_RECLAIM))
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index b497c71384e8..079228817603 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -678,15 +678,9 @@ nfs_file_direct_read(struct kiocb *iocb, char __user *buf, size_t count, loff_t
678 if (!count) 678 if (!count)
679 goto out; 679 goto out;
680 680
681 if (mapping->nrpages) { 681 retval = nfs_sync_mapping(mapping);
682 retval = filemap_fdatawrite(mapping); 682 if (retval)
683 if (retval == 0) 683 goto out;
684 retval = nfs_wb_all(inode);
685 if (retval == 0)
686 retval = filemap_fdatawait(mapping);
687 if (retval)
688 goto out;
689 }
690 684
691 retval = nfs_direct_read(inode, ctx, &iov, pos, 1); 685 retval = nfs_direct_read(inode, ctx, &iov, pos, 1);
692 if (retval > 0) 686 if (retval > 0)
@@ -764,15 +758,9 @@ nfs_file_direct_write(struct kiocb *iocb, const char __user *buf, size_t count,
764 if (!count) 758 if (!count)
765 goto out; 759 goto out;
766 760
767 if (mapping->nrpages) { 761 retval = nfs_sync_mapping(mapping);
768 retval = filemap_fdatawrite(mapping); 762 if (retval)
769 if (retval == 0) 763 goto out;
770 retval = nfs_wb_all(inode);
771 if (retval == 0)
772 retval = filemap_fdatawait(mapping);
773 if (retval)
774 goto out;
775 }
776 764
777 retval = nfs_direct_write(inode, ctx, &iov, pos, 1); 765 retval = nfs_direct_write(inode, ctx, &iov, pos, 1);
778 if (mapping->nrpages) 766 if (mapping->nrpages)
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index 57d3e77d97ee..eb5cd4c3bbfd 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -433,11 +433,7 @@ static int do_unlk(struct file *filp, int cmd, struct file_lock *fl)
433 * Flush all pending writes before doing anything 433 * Flush all pending writes before doing anything
434 * with locks.. 434 * with locks..
435 */ 435 */
436 filemap_fdatawrite(filp->f_mapping); 436 nfs_sync_mapping(filp->f_mapping);
437 down(&inode->i_sem);
438 nfs_wb_all(inode);
439 up(&inode->i_sem);
440 filemap_fdatawait(filp->f_mapping);
441 437
442 /* NOTE: special case 438 /* NOTE: special case
443 * If we're signalled while cleaning up locks on process exit, we 439 * If we're signalled while cleaning up locks on process exit, we
@@ -465,15 +461,8 @@ static int do_setlk(struct file *filp, int cmd, struct file_lock *fl)
465 * Flush all pending writes before doing anything 461 * Flush all pending writes before doing anything
466 * with locks.. 462 * with locks..
467 */ 463 */
468 status = filemap_fdatawrite(filp->f_mapping); 464 status = nfs_sync_mapping(filp->f_mapping);
469 if (status == 0) { 465 if (status != 0)
470 down(&inode->i_sem);
471 status = nfs_wb_all(inode);
472 up(&inode->i_sem);
473 if (status == 0)
474 status = filemap_fdatawait(filp->f_mapping);
475 }
476 if (status < 0)
477 goto out; 466 goto out;
478 467
479 lock_kernel(); 468 lock_kernel();
@@ -497,11 +486,7 @@ static int do_setlk(struct file *filp, int cmd, struct file_lock *fl)
497 * Make sure we clear the cache whenever we try to get the lock. 486 * Make sure we clear the cache whenever we try to get the lock.
498 * This makes locking act as a cache coherency point. 487 * This makes locking act as a cache coherency point.
499 */ 488 */
500 filemap_fdatawrite(filp->f_mapping); 489 nfs_sync_mapping(filp->f_mapping);
501 down(&inode->i_sem);
502 nfs_wb_all(inode); /* we may have slept */
503 up(&inode->i_sem);
504 filemap_fdatawait(filp->f_mapping);
505 nfs_zap_caches(inode); 490 nfs_zap_caches(inode);
506out: 491out:
507 rpc_clnt_sigunmask(NFS_CLIENT(inode), &oldset); 492 rpc_clnt_sigunmask(NFS_CLIENT(inode), &oldset);
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index afd75d0463fd..432f41cd75e6 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -640,6 +640,27 @@ static int nfs_show_options(struct seq_file *m, struct vfsmount *mnt)
640 return 0; 640 return 0;
641} 641}
642 642
643/**
644 * nfs_sync_mapping - helper to flush all mmapped dirty data to disk
645 */
646int nfs_sync_mapping(struct address_space *mapping)
647{
648 int ret;
649
650 if (mapping->nrpages == 0)
651 return 0;
652 unmap_mapping_range(mapping, 0, 0, 0);
653 ret = filemap_fdatawrite(mapping);
654 if (ret != 0)
655 goto out;
656 ret = filemap_fdatawait(mapping);
657 if (ret != 0)
658 goto out;
659 ret = nfs_wb_all(mapping->host);
660out:
661 return ret;
662}
663
643/* 664/*
644 * Invalidate the local caches 665 * Invalidate the local caches
645 */ 666 */
@@ -1179,11 +1200,8 @@ void nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping)
1179 struct nfs_inode *nfsi = NFS_I(inode); 1200 struct nfs_inode *nfsi = NFS_I(inode);
1180 1201
1181 if (nfsi->cache_validity & NFS_INO_INVALID_DATA) { 1202 if (nfsi->cache_validity & NFS_INO_INVALID_DATA) {
1182 if (S_ISREG(inode->i_mode)) { 1203 if (S_ISREG(inode->i_mode))
1183 if (filemap_fdatawrite(mapping) == 0) 1204 nfs_sync_mapping(mapping);
1184 filemap_fdatawait(mapping);
1185 nfs_wb_all(inode);
1186 }
1187 invalidate_inode_pages2(mapping); 1205 invalidate_inode_pages2(mapping);
1188 1206
1189 spin_lock(&inode->i_lock); 1207 spin_lock(&inode->i_lock);
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 12787a9b0259..2516adeccecf 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -291,6 +291,7 @@ static inline int nfs_verify_change_attribute(struct inode *inode, unsigned long
291/* 291/*
292 * linux/fs/nfs/inode.c 292 * linux/fs/nfs/inode.c
293 */ 293 */
294extern int nfs_sync_mapping(struct address_space *mapping);
294extern void nfs_zap_caches(struct inode *); 295extern void nfs_zap_caches(struct inode *);
295extern struct inode *nfs_fhget(struct super_block *, struct nfs_fh *, 296extern struct inode *nfs_fhget(struct super_block *, struct nfs_fh *,
296 struct nfs_fattr *); 297 struct nfs_fattr *);
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
index f44f46f1d8e0..8d782282ec19 100644
--- a/net/sunrpc/auth_gss/auth_gss.c
+++ b/net/sunrpc/auth_gss/auth_gss.c
@@ -638,7 +638,7 @@ gss_pipe_destroy_msg(struct rpc_pipe_msg *msg)
638 gss_msg); 638 gss_msg);
639 atomic_inc(&gss_msg->count); 639 atomic_inc(&gss_msg->count);
640 gss_unhash_msg(gss_msg); 640 gss_unhash_msg(gss_msg);
641 if (msg->errno == -ETIMEDOUT || msg->errno == -EPIPE) { 641 if (msg->errno == -ETIMEDOUT) {
642 unsigned long now = jiffies; 642 unsigned long now = jiffies;
643 if (time_after(now, ratelimit)) { 643 if (time_after(now, ratelimit)) {
644 printk(KERN_WARNING "RPC: AUTH_GSS upcall timed out.\n" 644 printk(KERN_WARNING "RPC: AUTH_GSS upcall timed out.\n"
@@ -786,7 +786,9 @@ gss_create_cred(struct rpc_auth *auth, struct auth_cred *acred, int taskflags)
786 cred->gc_flags = 0; 786 cred->gc_flags = 0;
787 cred->gc_base.cr_ops = &gss_credops; 787 cred->gc_base.cr_ops = &gss_credops;
788 cred->gc_service = gss_auth->service; 788 cred->gc_service = gss_auth->service;
789 err = gss_create_upcall(gss_auth, cred); 789 do {
790 err = gss_create_upcall(gss_auth, cred);
791 } while (err == -EAGAIN);
790 if (err < 0) 792 if (err < 0)
791 goto out_err; 793 goto out_err;
792 794
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index c76ea221798c..16a2458f38f7 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -174,7 +174,7 @@ rpc_pipe_release(struct inode *inode, struct file *filp)
174 goto out; 174 goto out;
175 msg = (struct rpc_pipe_msg *)filp->private_data; 175 msg = (struct rpc_pipe_msg *)filp->private_data;
176 if (msg != NULL) { 176 if (msg != NULL) {
177 msg->errno = -EPIPE; 177 msg->errno = -EAGAIN;
178 list_del_init(&msg->list); 178 list_del_init(&msg->list);
179 rpci->ops->destroy_msg(msg); 179 rpci->ops->destroy_msg(msg);
180 } 180 }
@@ -183,7 +183,7 @@ rpc_pipe_release(struct inode *inode, struct file *filp)
183 if (filp->f_mode & FMODE_READ) 183 if (filp->f_mode & FMODE_READ)
184 rpci->nreaders --; 184 rpci->nreaders --;
185 if (!rpci->nreaders) 185 if (!rpci->nreaders)
186 __rpc_purge_upcall(inode, -EPIPE); 186 __rpc_purge_upcall(inode, -EAGAIN);
187 if (rpci->ops->release_pipe) 187 if (rpci->ops->release_pipe)
188 rpci->ops->release_pipe(inode); 188 rpci->ops->release_pipe(inode);
189out: 189out:
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 0a51fd46a848..77e8800d4127 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -990,6 +990,7 @@ static void xs_udp_connect_worker(void *args)
990 sk->sk_data_ready = xs_udp_data_ready; 990 sk->sk_data_ready = xs_udp_data_ready;
991 sk->sk_write_space = xs_udp_write_space; 991 sk->sk_write_space = xs_udp_write_space;
992 sk->sk_no_check = UDP_CSUM_NORCV; 992 sk->sk_no_check = UDP_CSUM_NORCV;
993 sk->sk_allocation = GFP_ATOMIC;
993 994
994 xprt_set_connected(xprt); 995 xprt_set_connected(xprt);
995 996
@@ -1074,6 +1075,7 @@ static void xs_tcp_connect_worker(void *args)
1074 sk->sk_data_ready = xs_tcp_data_ready; 1075 sk->sk_data_ready = xs_tcp_data_ready;
1075 sk->sk_state_change = xs_tcp_state_change; 1076 sk->sk_state_change = xs_tcp_state_change;
1076 sk->sk_write_space = xs_tcp_write_space; 1077 sk->sk_write_space = xs_tcp_write_space;
1078 sk->sk_allocation = GFP_ATOMIC;
1077 1079
1078 /* socket options */ 1080 /* socket options */
1079 sk->sk_userlocks |= SOCK_BINDPORT_LOCK; 1081 sk->sk_userlocks |= SOCK_BINDPORT_LOCK;