aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/callback_xdr.c2
-rw-r--r--fs/nfs/client.c27
-rw-r--r--fs/nfs/fscache.c25
-rw-r--r--fs/nfs/fscache.h6
-rw-r--r--fs/nfs/nfs2xdr.c1
-rw-r--r--fs/nfs/nfs3proc.c1
-rw-r--r--fs/nfs/nfs3xdr.c1
-rw-r--r--fs/nfs/nfs4proc.c1
-rw-r--r--fs/nfs/nfs4state.c2
-rw-r--r--fs/nfs/nfs4xdr.c1
-rw-r--r--fs/nfs/proc.c1
-rw-r--r--fs/nfs/super.c80
-rw-r--r--fs/nfs/write.c1
13 files changed, 88 insertions, 61 deletions
diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c
index e5a2dac5f715..76b0aa0f73bf 100644
--- a/fs/nfs/callback_xdr.c
+++ b/fs/nfs/callback_xdr.c
@@ -222,7 +222,7 @@ static unsigned decode_sessionid(struct xdr_stream *xdr,
222 222
223 p = read_buf(xdr, len); 223 p = read_buf(xdr, len);
224 if (unlikely(p == NULL)) 224 if (unlikely(p == NULL))
225 return htonl(NFS4ERR_RESOURCE);; 225 return htonl(NFS4ERR_RESOURCE);
226 226
227 memcpy(sid->data, p, len); 227 memcpy(sid->data, p, len);
228 return 0; 228 return 0;
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index e350bd6a2334..63976c0ccc25 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -648,8 +648,6 @@ static int nfs_start_lockd(struct nfs_server *server)
648 .hostname = clp->cl_hostname, 648 .hostname = clp->cl_hostname,
649 .address = (struct sockaddr *)&clp->cl_addr, 649 .address = (struct sockaddr *)&clp->cl_addr,
650 .addrlen = clp->cl_addrlen, 650 .addrlen = clp->cl_addrlen,
651 .protocol = server->flags & NFS_MOUNT_TCP ?
652 IPPROTO_TCP : IPPROTO_UDP,
653 .nfs_version = clp->rpc_ops->version, 651 .nfs_version = clp->rpc_ops->version,
654 .noresvport = server->flags & NFS_MOUNT_NORESVPORT ? 652 .noresvport = server->flags & NFS_MOUNT_NORESVPORT ?
655 1 : 0, 653 1 : 0,
@@ -660,6 +658,14 @@ static int nfs_start_lockd(struct nfs_server *server)
660 if (server->flags & NFS_MOUNT_NONLM) 658 if (server->flags & NFS_MOUNT_NONLM)
661 return 0; 659 return 0;
662 660
661 switch (clp->cl_proto) {
662 default:
663 nlm_init.protocol = IPPROTO_TCP;
664 break;
665 case XPRT_TRANSPORT_UDP:
666 nlm_init.protocol = IPPROTO_UDP;
667 }
668
663 host = nlmclnt_init(&nlm_init); 669 host = nlmclnt_init(&nlm_init);
664 if (IS_ERR(host)) 670 if (IS_ERR(host))
665 return PTR_ERR(host); 671 return PTR_ERR(host);
@@ -787,7 +793,7 @@ static int nfs_init_server(struct nfs_server *server,
787 dprintk("--> nfs_init_server()\n"); 793 dprintk("--> nfs_init_server()\n");
788 794
789#ifdef CONFIG_NFS_V3 795#ifdef CONFIG_NFS_V3
790 if (data->flags & NFS_MOUNT_VER3) 796 if (data->version == 3)
791 cl_init.rpc_ops = &nfs_v3_clientops; 797 cl_init.rpc_ops = &nfs_v3_clientops;
792#endif 798#endif
793 799
@@ -933,10 +939,6 @@ static int nfs_probe_fsinfo(struct nfs_server *server, struct nfs_fh *mntfh, str
933 goto out_error; 939 goto out_error;
934 940
935 nfs_server_set_fsinfo(server, &fsinfo); 941 nfs_server_set_fsinfo(server, &fsinfo);
936 error = bdi_init(&server->backing_dev_info);
937 if (error)
938 goto out_error;
939
940 942
941 /* Get some general file system info */ 943 /* Get some general file system info */
942 if (server->namelen == 0) { 944 if (server->namelen == 0) {
@@ -968,6 +970,7 @@ static void nfs_server_copy_userdata(struct nfs_server *target, struct nfs_serve
968 target->acdirmin = source->acdirmin; 970 target->acdirmin = source->acdirmin;
969 target->acdirmax = source->acdirmax; 971 target->acdirmax = source->acdirmax;
970 target->caps = source->caps; 972 target->caps = source->caps;
973 target->options = source->options;
971} 974}
972 975
973/* 976/*
@@ -995,6 +998,12 @@ static struct nfs_server *nfs_alloc_server(void)
995 return NULL; 998 return NULL;
996 } 999 }
997 1000
1001 if (bdi_init(&server->backing_dev_info)) {
1002 nfs_free_iostats(server->io_stats);
1003 kfree(server);
1004 return NULL;
1005 }
1006
998 return server; 1007 return server;
999} 1008}
1000 1009
@@ -1529,7 +1538,7 @@ static void *nfs_server_list_next(struct seq_file *p, void *v, loff_t *pos);
1529static void nfs_server_list_stop(struct seq_file *p, void *v); 1538static void nfs_server_list_stop(struct seq_file *p, void *v);
1530static int nfs_server_list_show(struct seq_file *m, void *v); 1539static int nfs_server_list_show(struct seq_file *m, void *v);
1531 1540
1532static struct seq_operations nfs_server_list_ops = { 1541static const struct seq_operations nfs_server_list_ops = {
1533 .start = nfs_server_list_start, 1542 .start = nfs_server_list_start,
1534 .next = nfs_server_list_next, 1543 .next = nfs_server_list_next,
1535 .stop = nfs_server_list_stop, 1544 .stop = nfs_server_list_stop,
@@ -1550,7 +1559,7 @@ static void *nfs_volume_list_next(struct seq_file *p, void *v, loff_t *pos);
1550static void nfs_volume_list_stop(struct seq_file *p, void *v); 1559static void nfs_volume_list_stop(struct seq_file *p, void *v);
1551static int nfs_volume_list_show(struct seq_file *m, void *v); 1560static int nfs_volume_list_show(struct seq_file *m, void *v);
1552 1561
1553static struct seq_operations nfs_volume_list_ops = { 1562static const struct seq_operations nfs_volume_list_ops = {
1554 .start = nfs_volume_list_start, 1563 .start = nfs_volume_list_start,
1555 .next = nfs_volume_list_next, 1564 .next = nfs_volume_list_next,
1556 .stop = nfs_volume_list_stop, 1565 .stop = nfs_volume_list_stop,
diff --git a/fs/nfs/fscache.c b/fs/nfs/fscache.c
index 379be678cb7e..70fad69eb959 100644
--- a/fs/nfs/fscache.c
+++ b/fs/nfs/fscache.c
@@ -58,17 +58,34 @@ void nfs_fscache_release_client_cookie(struct nfs_client *clp)
58/* 58/*
59 * Get the cache cookie for an NFS superblock. We have to handle 59 * Get the cache cookie for an NFS superblock. We have to handle
60 * uniquification here because the cache doesn't do it for us. 60 * uniquification here because the cache doesn't do it for us.
61 *
62 * The default uniquifier is just an empty string, but it may be overridden
63 * either by the 'fsc=xxx' option to mount, or by inheriting it from the parent
64 * superblock across an automount point of some nature.
61 */ 65 */
62void nfs_fscache_get_super_cookie(struct super_block *sb, 66void nfs_fscache_get_super_cookie(struct super_block *sb, const char *uniq,
63 struct nfs_parsed_mount_data *data) 67 struct nfs_clone_mount *mntdata)
64{ 68{
65 struct nfs_fscache_key *key, *xkey; 69 struct nfs_fscache_key *key, *xkey;
66 struct nfs_server *nfss = NFS_SB(sb); 70 struct nfs_server *nfss = NFS_SB(sb);
67 struct rb_node **p, *parent; 71 struct rb_node **p, *parent;
68 const char *uniq = data->fscache_uniq ?: "";
69 int diff, ulen; 72 int diff, ulen;
70 73
71 ulen = strlen(uniq); 74 if (uniq) {
75 ulen = strlen(uniq);
76 } else if (mntdata) {
77 struct nfs_server *mnt_s = NFS_SB(mntdata->sb);
78 if (mnt_s->fscache_key) {
79 uniq = mnt_s->fscache_key->key.uniquifier;
80 ulen = mnt_s->fscache_key->key.uniq_len;
81 }
82 }
83
84 if (!uniq) {
85 uniq = "";
86 ulen = 1;
87 }
88
72 key = kzalloc(sizeof(*key) + ulen, GFP_KERNEL); 89 key = kzalloc(sizeof(*key) + ulen, GFP_KERNEL);
73 if (!key) 90 if (!key)
74 return; 91 return;
diff --git a/fs/nfs/fscache.h b/fs/nfs/fscache.h
index 6e809bb0ff08..b9c572d0679f 100644
--- a/fs/nfs/fscache.h
+++ b/fs/nfs/fscache.h
@@ -74,7 +74,8 @@ extern void nfs_fscache_get_client_cookie(struct nfs_client *);
74extern void nfs_fscache_release_client_cookie(struct nfs_client *); 74extern void nfs_fscache_release_client_cookie(struct nfs_client *);
75 75
76extern void nfs_fscache_get_super_cookie(struct super_block *, 76extern void nfs_fscache_get_super_cookie(struct super_block *,
77 struct nfs_parsed_mount_data *); 77 const char *,
78 struct nfs_clone_mount *);
78extern void nfs_fscache_release_super_cookie(struct super_block *); 79extern void nfs_fscache_release_super_cookie(struct super_block *);
79 80
80extern void nfs_fscache_init_inode_cookie(struct inode *); 81extern void nfs_fscache_init_inode_cookie(struct inode *);
@@ -173,7 +174,8 @@ static inline void nfs_fscache_release_client_cookie(struct nfs_client *clp) {}
173 174
174static inline void nfs_fscache_get_super_cookie( 175static inline void nfs_fscache_get_super_cookie(
175 struct super_block *sb, 176 struct super_block *sb,
176 struct nfs_parsed_mount_data *data) 177 const char *uniq,
178 struct nfs_clone_mount *mntdata)
177{ 179{
178} 180}
179static inline void nfs_fscache_release_super_cookie(struct super_block *sb) {} 181static inline void nfs_fscache_release_super_cookie(struct super_block *sb) {}
diff --git a/fs/nfs/nfs2xdr.c b/fs/nfs/nfs2xdr.c
index c862c9340f9a..5e078b222b4e 100644
--- a/fs/nfs/nfs2xdr.c
+++ b/fs/nfs/nfs2xdr.c
@@ -13,7 +13,6 @@
13#include <linux/time.h> 13#include <linux/time.h>
14#include <linux/mm.h> 14#include <linux/mm.h>
15#include <linux/slab.h> 15#include <linux/slab.h>
16#include <linux/utsname.h>
17#include <linux/errno.h> 16#include <linux/errno.h>
18#include <linux/string.h> 17#include <linux/string.h>
19#include <linux/in.h> 18#include <linux/in.h>
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c
index ee6a13f05443..3f8881d1a050 100644
--- a/fs/nfs/nfs3proc.c
+++ b/fs/nfs/nfs3proc.c
@@ -7,7 +7,6 @@
7 */ 7 */
8 8
9#include <linux/mm.h> 9#include <linux/mm.h>
10#include <linux/utsname.h>
11#include <linux/errno.h> 10#include <linux/errno.h>
12#include <linux/string.h> 11#include <linux/string.h>
13#include <linux/sunrpc/clnt.h> 12#include <linux/sunrpc/clnt.h>
diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c
index 35869a4921f1..5fe5492fbd29 100644
--- a/fs/nfs/nfs3xdr.c
+++ b/fs/nfs/nfs3xdr.c
@@ -10,7 +10,6 @@
10#include <linux/time.h> 10#include <linux/time.h>
11#include <linux/mm.h> 11#include <linux/mm.h>
12#include <linux/slab.h> 12#include <linux/slab.h>
13#include <linux/utsname.h>
14#include <linux/errno.h> 13#include <linux/errno.h>
15#include <linux/string.h> 14#include <linux/string.h>
16#include <linux/in.h> 15#include <linux/in.h>
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index be6544aef41f..ed7c269e2514 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -36,7 +36,6 @@
36 */ 36 */
37 37
38#include <linux/mm.h> 38#include <linux/mm.h>
39#include <linux/utsname.h>
40#include <linux/delay.h> 39#include <linux/delay.h>
41#include <linux/errno.h> 40#include <linux/errno.h>
42#include <linux/string.h> 41#include <linux/string.h>
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index 1434080aefeb..2ef4fecf3984 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -638,7 +638,7 @@ static void nfs4_fl_release_lock(struct file_lock *fl)
638 nfs4_put_lock_state(fl->fl_u.nfs4_fl.owner); 638 nfs4_put_lock_state(fl->fl_u.nfs4_fl.owner);
639} 639}
640 640
641static struct file_lock_operations nfs4_fl_lock_ops = { 641static const struct file_lock_operations nfs4_fl_lock_ops = {
642 .fl_copy_lock = nfs4_fl_copy_lock, 642 .fl_copy_lock = nfs4_fl_copy_lock,
643 .fl_release_private = nfs4_fl_release_lock, 643 .fl_release_private = nfs4_fl_release_lock,
644}; 644};
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index cfc30d362f94..83ad47cbdd8a 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -39,7 +39,6 @@
39#include <linux/time.h> 39#include <linux/time.h>
40#include <linux/mm.h> 40#include <linux/mm.h>
41#include <linux/slab.h> 41#include <linux/slab.h>
42#include <linux/utsname.h>
43#include <linux/errno.h> 42#include <linux/errno.h>
44#include <linux/string.h> 43#include <linux/string.h>
45#include <linux/in.h> 44#include <linux/in.h>
diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c
index 7be72d90d49d..ef583854d8d0 100644
--- a/fs/nfs/proc.c
+++ b/fs/nfs/proc.c
@@ -32,7 +32,6 @@
32#include <linux/slab.h> 32#include <linux/slab.h>
33#include <linux/time.h> 33#include <linux/time.h>
34#include <linux/mm.h> 34#include <linux/mm.h>
35#include <linux/utsname.h>
36#include <linux/errno.h> 35#include <linux/errno.h>
37#include <linux/string.h> 36#include <linux/string.h>
38#include <linux/in.h> 37#include <linux/in.h>
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 867f70504531..810770f96816 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -728,6 +728,27 @@ static void nfs_umount_begin(struct super_block *sb)
728 unlock_kernel(); 728 unlock_kernel();
729} 729}
730 730
731static struct nfs_parsed_mount_data *nfs_alloc_parsed_mount_data(int flags)
732{
733 struct nfs_parsed_mount_data *data;
734
735 data = kzalloc(sizeof(*data), GFP_KERNEL);
736 if (data) {
737 data->flags = flags;
738 data->rsize = NFS_MAX_FILE_IO_SIZE;
739 data->wsize = NFS_MAX_FILE_IO_SIZE;
740 data->acregmin = NFS_DEF_ACREGMIN;
741 data->acregmax = NFS_DEF_ACREGMAX;
742 data->acdirmin = NFS_DEF_ACDIRMIN;
743 data->acdirmax = NFS_DEF_ACDIRMAX;
744 data->nfs_server.port = NFS_UNSPEC_PORT;
745 data->auth_flavors[0] = RPC_AUTH_UNIX;
746 data->auth_flavor_len = 1;
747 data->minorversion = 0;
748 }
749 return data;
750}
751
731/* 752/*
732 * Sanity-check a server address provided by the mount command. 753 * Sanity-check a server address provided by the mount command.
733 * 754 *
@@ -1430,10 +1451,13 @@ static int nfs_try_mount(struct nfs_parsed_mount_data *args,
1430 int status; 1451 int status;
1431 1452
1432 if (args->mount_server.version == 0) { 1453 if (args->mount_server.version == 0) {
1433 if (args->flags & NFS_MOUNT_VER3) 1454 switch (args->version) {
1434 args->mount_server.version = NFS_MNT3_VERSION; 1455 default:
1435 else 1456 args->mount_server.version = NFS_MNT3_VERSION;
1436 args->mount_server.version = NFS_MNT_VERSION; 1457 break;
1458 case 2:
1459 args->mount_server.version = NFS_MNT_VERSION;
1460 }
1437 } 1461 }
1438 request.version = args->mount_server.version; 1462 request.version = args->mount_server.version;
1439 1463
@@ -1634,20 +1658,6 @@ static int nfs_validate_mount_data(void *options,
1634 if (data == NULL) 1658 if (data == NULL)
1635 goto out_no_data; 1659 goto out_no_data;
1636 1660
1637 args->flags = (NFS_MOUNT_VER3 | NFS_MOUNT_TCP);
1638 args->rsize = NFS_MAX_FILE_IO_SIZE;
1639 args->wsize = NFS_MAX_FILE_IO_SIZE;
1640 args->acregmin = NFS_DEF_ACREGMIN;
1641 args->acregmax = NFS_DEF_ACREGMAX;
1642 args->acdirmin = NFS_DEF_ACDIRMIN;
1643 args->acdirmax = NFS_DEF_ACDIRMAX;
1644 args->mount_server.port = NFS_UNSPEC_PORT;
1645 args->nfs_server.port = NFS_UNSPEC_PORT;
1646 args->nfs_server.protocol = XPRT_TRANSPORT_TCP;
1647 args->auth_flavors[0] = RPC_AUTH_UNIX;
1648 args->auth_flavor_len = 1;
1649 args->minorversion = 0;
1650
1651 switch (data->version) { 1661 switch (data->version) {
1652 case 1: 1662 case 1:
1653 data->namlen = 0; 1663 data->namlen = 0;
@@ -1778,7 +1788,7 @@ static int nfs_validate_mount_data(void *options,
1778 } 1788 }
1779 1789
1780#ifndef CONFIG_NFS_V3 1790#ifndef CONFIG_NFS_V3
1781 if (args->flags & NFS_MOUNT_VER3) 1791 if (args->version == 3)
1782 goto out_v3_not_compiled; 1792 goto out_v3_not_compiled;
1783#endif /* !CONFIG_NFS_V3 */ 1793#endif /* !CONFIG_NFS_V3 */
1784 1794
@@ -1918,6 +1928,8 @@ static inline void nfs_initialise_sb(struct super_block *sb)
1918 if (server->flags & NFS_MOUNT_NOAC) 1928 if (server->flags & NFS_MOUNT_NOAC)
1919 sb->s_flags |= MS_SYNCHRONOUS; 1929 sb->s_flags |= MS_SYNCHRONOUS;
1920 1930
1931 sb->s_bdi = &server->backing_dev_info;
1932
1921 nfs_super_set_maxbytes(sb, server->maxfilesize); 1933 nfs_super_set_maxbytes(sb, server->maxfilesize);
1922} 1934}
1923 1935
@@ -1934,7 +1946,7 @@ static void nfs_fill_super(struct super_block *sb,
1934 if (data->bsize) 1946 if (data->bsize)
1935 sb->s_blocksize = nfs_block_size(data->bsize, &sb->s_blocksize_bits); 1947 sb->s_blocksize = nfs_block_size(data->bsize, &sb->s_blocksize_bits);
1936 1948
1937 if (server->flags & NFS_MOUNT_VER3) { 1949 if (server->nfs_client->rpc_ops->version == 3) {
1938 /* The VFS shouldn't apply the umask to mode bits. We will do 1950 /* The VFS shouldn't apply the umask to mode bits. We will do
1939 * so ourselves when necessary. 1951 * so ourselves when necessary.
1940 */ 1952 */
@@ -1958,7 +1970,7 @@ static void nfs_clone_super(struct super_block *sb,
1958 sb->s_blocksize = old_sb->s_blocksize; 1970 sb->s_blocksize = old_sb->s_blocksize;
1959 sb->s_maxbytes = old_sb->s_maxbytes; 1971 sb->s_maxbytes = old_sb->s_maxbytes;
1960 1972
1961 if (server->flags & NFS_MOUNT_VER3) { 1973 if (server->nfs_client->rpc_ops->version == 3) {
1962 /* The VFS shouldn't apply the umask to mode bits. We will do 1974 /* The VFS shouldn't apply the umask to mode bits. We will do
1963 * so ourselves when necessary. 1975 * so ourselves when necessary.
1964 */ 1976 */
@@ -2092,7 +2104,7 @@ static int nfs_get_sb(struct file_system_type *fs_type,
2092 }; 2104 };
2093 int error = -ENOMEM; 2105 int error = -ENOMEM;
2094 2106
2095 data = kzalloc(sizeof(*data), GFP_KERNEL); 2107 data = nfs_alloc_parsed_mount_data(NFS_MOUNT_VER3 | NFS_MOUNT_TCP);
2096 mntfh = kzalloc(sizeof(*mntfh), GFP_KERNEL); 2108 mntfh = kzalloc(sizeof(*mntfh), GFP_KERNEL);
2097 if (data == NULL || mntfh == NULL) 2109 if (data == NULL || mntfh == NULL)
2098 goto out_free_fh; 2110 goto out_free_fh;
@@ -2142,7 +2154,8 @@ static int nfs_get_sb(struct file_system_type *fs_type,
2142 if (!s->s_root) { 2154 if (!s->s_root) {
2143 /* initial superblock/root creation */ 2155 /* initial superblock/root creation */
2144 nfs_fill_super(s, data); 2156 nfs_fill_super(s, data);
2145 nfs_fscache_get_super_cookie(s, data); 2157 nfs_fscache_get_super_cookie(
2158 s, data ? data->fscache_uniq : NULL, NULL);
2146 } 2159 }
2147 2160
2148 mntroot = nfs_get_root(s, mntfh); 2161 mntroot = nfs_get_root(s, mntfh);
@@ -2188,8 +2201,8 @@ static void nfs_kill_super(struct super_block *s)
2188{ 2201{
2189 struct nfs_server *server = NFS_SB(s); 2202 struct nfs_server *server = NFS_SB(s);
2190 2203
2191 bdi_unregister(&server->backing_dev_info);
2192 kill_anon_super(s); 2204 kill_anon_super(s);
2205 bdi_unregister(&server->backing_dev_info);
2193 nfs_fscache_release_super_cookie(s); 2206 nfs_fscache_release_super_cookie(s);
2194 nfs_free_server(server); 2207 nfs_free_server(server);
2195} 2208}
@@ -2243,6 +2256,7 @@ static int nfs_xdev_get_sb(struct file_system_type *fs_type, int flags,
2243 if (!s->s_root) { 2256 if (!s->s_root) {
2244 /* initial superblock/root creation */ 2257 /* initial superblock/root creation */
2245 nfs_clone_super(s, data->sb); 2258 nfs_clone_super(s, data->sb);
2259 nfs_fscache_get_super_cookie(s, NULL, data);
2246 } 2260 }
2247 2261
2248 mntroot = nfs_get_root(s, data->fh); 2262 mntroot = nfs_get_root(s, data->fh);
@@ -2360,18 +2374,7 @@ static int nfs4_validate_mount_data(void *options,
2360 if (data == NULL) 2374 if (data == NULL)
2361 goto out_no_data; 2375 goto out_no_data;
2362 2376
2363 args->rsize = NFS_MAX_FILE_IO_SIZE;
2364 args->wsize = NFS_MAX_FILE_IO_SIZE;
2365 args->acregmin = NFS_DEF_ACREGMIN;
2366 args->acregmax = NFS_DEF_ACREGMAX;
2367 args->acdirmin = NFS_DEF_ACDIRMIN;
2368 args->acdirmax = NFS_DEF_ACDIRMAX;
2369 args->nfs_server.port = NFS_UNSPEC_PORT;
2370 args->auth_flavors[0] = RPC_AUTH_UNIX;
2371 args->auth_flavor_len = 1;
2372 args->version = 4; 2377 args->version = 4;
2373 args->minorversion = 0;
2374
2375 switch (data->version) { 2378 switch (data->version) {
2376 case 1: 2379 case 1:
2377 if (data->host_addrlen > sizeof(args->nfs_server.address)) 2380 if (data->host_addrlen > sizeof(args->nfs_server.address))
@@ -2506,7 +2509,8 @@ static int nfs4_remote_get_sb(struct file_system_type *fs_type,
2506 if (!s->s_root) { 2509 if (!s->s_root) {
2507 /* initial superblock/root creation */ 2510 /* initial superblock/root creation */
2508 nfs4_fill_super(s); 2511 nfs4_fill_super(s);
2509 nfs_fscache_get_super_cookie(s, data); 2512 nfs_fscache_get_super_cookie(
2513 s, data ? data->fscache_uniq : NULL, NULL);
2510 } 2514 }
2511 2515
2512 mntroot = nfs4_get_root(s, mntfh); 2516 mntroot = nfs4_get_root(s, mntfh);
@@ -2654,7 +2658,7 @@ static int nfs4_get_sb(struct file_system_type *fs_type,
2654 struct nfs_parsed_mount_data *data; 2658 struct nfs_parsed_mount_data *data;
2655 int error = -ENOMEM; 2659 int error = -ENOMEM;
2656 2660
2657 data = kzalloc(sizeof(*data), GFP_KERNEL); 2661 data = nfs_alloc_parsed_mount_data(0);
2658 if (data == NULL) 2662 if (data == NULL)
2659 goto out_free_data; 2663 goto out_free_data;
2660 2664
@@ -2739,6 +2743,7 @@ static int nfs4_xdev_get_sb(struct file_system_type *fs_type, int flags,
2739 if (!s->s_root) { 2743 if (!s->s_root) {
2740 /* initial superblock/root creation */ 2744 /* initial superblock/root creation */
2741 nfs4_clone_super(s, data->sb); 2745 nfs4_clone_super(s, data->sb);
2746 nfs_fscache_get_super_cookie(s, NULL, data);
2742 } 2747 }
2743 2748
2744 mntroot = nfs4_get_root(s, data->fh); 2749 mntroot = nfs4_get_root(s, data->fh);
@@ -2820,6 +2825,7 @@ static int nfs4_remote_referral_get_sb(struct file_system_type *fs_type,
2820 if (!s->s_root) { 2825 if (!s->s_root) {
2821 /* initial superblock/root creation */ 2826 /* initial superblock/root creation */
2822 nfs4_fill_super(s); 2827 nfs4_fill_super(s);
2828 nfs_fscache_get_super_cookie(s, NULL, data);
2823 } 2829 }
2824 2830
2825 mntroot = nfs4_get_root(s, &mntfh); 2831 mntroot = nfs4_get_root(s, &mntfh);
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 120acadc6a84..53eb26c16b50 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -1490,7 +1490,6 @@ static int nfs_write_mapping(struct address_space *mapping, int how)
1490 .nr_to_write = LONG_MAX, 1490 .nr_to_write = LONG_MAX,
1491 .range_start = 0, 1491 .range_start = 0,
1492 .range_end = LLONG_MAX, 1492 .range_end = LLONG_MAX,
1493 .for_writepages = 1,
1494 }; 1493 };
1495 1494
1496 return __nfs_write_mapping(mapping, &wbc, how); 1495 return __nfs_write_mapping(mapping, &wbc, how);