diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-10 10:52:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-10 10:52:35 -0400 |
commit | df632d3ce7eacf92ad9b642301c7b53a1d95b8d8 (patch) | |
tree | 848c39ed4f7cfdb582bf2e0a0a03147efaa5198d /fs/nfs/super.c | |
parent | 2474542f64432398f503373f53bdf620491bcfa8 (diff) | |
parent | af283885b70248268617955a5ea5476647bd556b (diff) |
Merge tag 'nfs-for-3.7-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
Pull NFS client updates from Trond Myklebust:
"Features include:
- Remove CONFIG_EXPERIMENTAL dependency from NFSv4.1
Aside from the issues discussed at the LKS, distros are shipping
NFSv4.1 with all the trimmings.
- Fix fdatasync()/fsync() for the corner case of a server reboot.
- NFSv4 OPEN access fix: finally distinguish correctly between
open-for-read and open-for-execute permissions in all situations.
- Ensure that the TCP socket is closed when we're in CLOSE_WAIT
- More idmapper bugfixes
- Lots of pNFS bugfixes and cleanups to remove unnecessary state and
make the code easier to read.
- In cases where a pNFS read or write fails, allow the client to
resume trying layoutgets after two minutes of read/write-
through-mds.
- More net namespace fixes to the NFSv4 callback code.
- More net namespace fixes to the NFSv3 locking code.
- More NFSv4 migration preparatory patches.
Including patches to detect network trunking in both NFSv4 and
NFSv4.1
- pNFS block updates to optimise LAYOUTGET calls."
* tag 'nfs-for-3.7-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (113 commits)
pnfsblock: cleanup nfs4_blkdev_get
NFS41: send real read size in layoutget
NFS41: send real write size in layoutget
NFS: track direct IO left bytes
NFSv4.1: Cleanup ugliness in pnfs_layoutgets_blocked()
NFSv4.1: Ensure that the layout sequence id stays 'close' to the current
NFSv4.1: Deal with seqid wraparound in the pNFS return-on-close code
NFSv4 set open access operation call flag in nfs4_init_opendata_res
NFSv4.1: Remove the dependency on CONFIG_EXPERIMENTAL
NFSv4 reduce attribute requests for open reclaim
NFSv4: nfs4_open_done first must check that GETATTR decoded a file type
NFSv4.1: Deal with wraparound when updating the layout "barrier" seqid
NFSv4.1: Deal with wraparound issues when updating the layout stateid
NFSv4.1: Always set the layout stateid if this is the first layoutget
NFSv4.1: Fix another refcount issue in pnfs_find_alloc_layout
NFSv4: don't put ACCESS in OPEN compound if O_EXCL
NFSv4: don't check MAY_WRITE access bit in OPEN
NFS: Set key construction data for the legacy upcall
NFSv4.1: don't do two EXCHANGE_IDs on mount
NFS: nfs41_walk_client_list(): re-lock before iterating
...
Diffstat (limited to 'fs/nfs/super.c')
-rw-r--r-- | fs/nfs/super.c | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index d2c7f5db0847..e831bce49766 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
@@ -88,6 +88,7 @@ enum { | |||
88 | Opt_sharecache, Opt_nosharecache, | 88 | Opt_sharecache, Opt_nosharecache, |
89 | Opt_resvport, Opt_noresvport, | 89 | Opt_resvport, Opt_noresvport, |
90 | Opt_fscache, Opt_nofscache, | 90 | Opt_fscache, Opt_nofscache, |
91 | Opt_migration, Opt_nomigration, | ||
91 | 92 | ||
92 | /* Mount options that take integer arguments */ | 93 | /* Mount options that take integer arguments */ |
93 | Opt_port, | 94 | Opt_port, |
@@ -147,6 +148,8 @@ static const match_table_t nfs_mount_option_tokens = { | |||
147 | { Opt_noresvport, "noresvport" }, | 148 | { Opt_noresvport, "noresvport" }, |
148 | { Opt_fscache, "fsc" }, | 149 | { Opt_fscache, "fsc" }, |
149 | { Opt_nofscache, "nofsc" }, | 150 | { Opt_nofscache, "nofsc" }, |
151 | { Opt_migration, "migration" }, | ||
152 | { Opt_nomigration, "nomigration" }, | ||
150 | 153 | ||
151 | { Opt_port, "port=%s" }, | 154 | { Opt_port, "port=%s" }, |
152 | { Opt_rsize, "rsize=%s" }, | 155 | { Opt_rsize, "rsize=%s" }, |
@@ -676,6 +679,9 @@ static void nfs_show_mount_options(struct seq_file *m, struct nfs_server *nfss, | |||
676 | if (nfss->options & NFS_OPTION_FSCACHE) | 679 | if (nfss->options & NFS_OPTION_FSCACHE) |
677 | seq_printf(m, ",fsc"); | 680 | seq_printf(m, ",fsc"); |
678 | 681 | ||
682 | if (nfss->options & NFS_OPTION_MIGRATION) | ||
683 | seq_printf(m, ",migration"); | ||
684 | |||
679 | if (nfss->flags & NFS_MOUNT_LOOKUP_CACHE_NONEG) { | 685 | if (nfss->flags & NFS_MOUNT_LOOKUP_CACHE_NONEG) { |
680 | if (nfss->flags & NFS_MOUNT_LOOKUP_CACHE_NONE) | 686 | if (nfss->flags & NFS_MOUNT_LOOKUP_CACHE_NONE) |
681 | seq_printf(m, ",lookupcache=none"); | 687 | seq_printf(m, ",lookupcache=none"); |
@@ -1106,7 +1112,7 @@ static int nfs_get_option_ul(substring_t args[], unsigned long *option) | |||
1106 | string = match_strdup(args); | 1112 | string = match_strdup(args); |
1107 | if (string == NULL) | 1113 | if (string == NULL) |
1108 | return -ENOMEM; | 1114 | return -ENOMEM; |
1109 | rc = strict_strtoul(string, 10, option); | 1115 | rc = kstrtoul(string, 10, option); |
1110 | kfree(string); | 1116 | kfree(string); |
1111 | 1117 | ||
1112 | return rc; | 1118 | return rc; |
@@ -1243,6 +1249,12 @@ static int nfs_parse_mount_options(char *raw, | |||
1243 | kfree(mnt->fscache_uniq); | 1249 | kfree(mnt->fscache_uniq); |
1244 | mnt->fscache_uniq = NULL; | 1250 | mnt->fscache_uniq = NULL; |
1245 | break; | 1251 | break; |
1252 | case Opt_migration: | ||
1253 | mnt->options |= NFS_OPTION_MIGRATION; | ||
1254 | break; | ||
1255 | case Opt_nomigration: | ||
1256 | mnt->options &= NFS_OPTION_MIGRATION; | ||
1257 | break; | ||
1246 | 1258 | ||
1247 | /* | 1259 | /* |
1248 | * options that take numeric values | 1260 | * options that take numeric values |
@@ -1535,6 +1547,10 @@ static int nfs_parse_mount_options(char *raw, | |||
1535 | if (mnt->minorversion && mnt->version != 4) | 1547 | if (mnt->minorversion && mnt->version != 4) |
1536 | goto out_minorversion_mismatch; | 1548 | goto out_minorversion_mismatch; |
1537 | 1549 | ||
1550 | if (mnt->options & NFS_OPTION_MIGRATION && | ||
1551 | mnt->version != 4 && mnt->minorversion != 0) | ||
1552 | goto out_migration_misuse; | ||
1553 | |||
1538 | /* | 1554 | /* |
1539 | * verify that any proto=/mountproto= options match the address | 1555 | * verify that any proto=/mountproto= options match the address |
1540 | * families in the addr=/mountaddr= options. | 1556 | * families in the addr=/mountaddr= options. |
@@ -1572,6 +1588,10 @@ out_minorversion_mismatch: | |||
1572 | printk(KERN_INFO "NFS: mount option vers=%u does not support " | 1588 | printk(KERN_INFO "NFS: mount option vers=%u does not support " |
1573 | "minorversion=%u\n", mnt->version, mnt->minorversion); | 1589 | "minorversion=%u\n", mnt->version, mnt->minorversion); |
1574 | return 0; | 1590 | return 0; |
1591 | out_migration_misuse: | ||
1592 | printk(KERN_INFO | ||
1593 | "NFS: 'migration' not supported for this NFS version\n"); | ||
1594 | return 0; | ||
1575 | out_nomem: | 1595 | out_nomem: |
1576 | printk(KERN_INFO "NFS: not enough memory to parse option\n"); | 1596 | printk(KERN_INFO "NFS: not enough memory to parse option\n"); |
1577 | return 0; | 1597 | return 0; |
@@ -2494,7 +2514,7 @@ EXPORT_SYMBOL_GPL(nfs_kill_super); | |||
2494 | /* | 2514 | /* |
2495 | * Clone an NFS2/3/4 server record on xdev traversal (FSID-change) | 2515 | * Clone an NFS2/3/4 server record on xdev traversal (FSID-change) |
2496 | */ | 2516 | */ |
2497 | struct dentry * | 2517 | static struct dentry * |
2498 | nfs_xdev_mount(struct file_system_type *fs_type, int flags, | 2518 | nfs_xdev_mount(struct file_system_type *fs_type, int flags, |
2499 | const char *dev_name, void *raw_data) | 2519 | const char *dev_name, void *raw_data) |
2500 | { | 2520 | { |
@@ -2642,6 +2662,7 @@ unsigned int nfs_idmap_cache_timeout = 600; | |||
2642 | bool nfs4_disable_idmapping = true; | 2662 | bool nfs4_disable_idmapping = true; |
2643 | unsigned short max_session_slots = NFS4_DEF_SLOT_TABLE_SIZE; | 2663 | unsigned short max_session_slots = NFS4_DEF_SLOT_TABLE_SIZE; |
2644 | unsigned short send_implementation_id = 1; | 2664 | unsigned short send_implementation_id = 1; |
2665 | char nfs4_client_id_uniquifier[NFS4_CLIENT_ID_UNIQ_LEN] = ""; | ||
2645 | 2666 | ||
2646 | EXPORT_SYMBOL_GPL(nfs_callback_set_tcpport); | 2667 | EXPORT_SYMBOL_GPL(nfs_callback_set_tcpport); |
2647 | EXPORT_SYMBOL_GPL(nfs_callback_tcpport); | 2668 | EXPORT_SYMBOL_GPL(nfs_callback_tcpport); |
@@ -2649,6 +2670,7 @@ EXPORT_SYMBOL_GPL(nfs_idmap_cache_timeout); | |||
2649 | EXPORT_SYMBOL_GPL(nfs4_disable_idmapping); | 2670 | EXPORT_SYMBOL_GPL(nfs4_disable_idmapping); |
2650 | EXPORT_SYMBOL_GPL(max_session_slots); | 2671 | EXPORT_SYMBOL_GPL(max_session_slots); |
2651 | EXPORT_SYMBOL_GPL(send_implementation_id); | 2672 | EXPORT_SYMBOL_GPL(send_implementation_id); |
2673 | EXPORT_SYMBOL_GPL(nfs4_client_id_uniquifier); | ||
2652 | 2674 | ||
2653 | #define NFS_CALLBACK_MAXPORTNR (65535U) | 2675 | #define NFS_CALLBACK_MAXPORTNR (65535U) |
2654 | 2676 | ||
@@ -2659,7 +2681,7 @@ static int param_set_portnr(const char *val, const struct kernel_param *kp) | |||
2659 | 2681 | ||
2660 | if (!val) | 2682 | if (!val) |
2661 | return -EINVAL; | 2683 | return -EINVAL; |
2662 | ret = strict_strtoul(val, 0, &num); | 2684 | ret = kstrtoul(val, 0, &num); |
2663 | if (ret == -EINVAL || num > NFS_CALLBACK_MAXPORTNR) | 2685 | if (ret == -EINVAL || num > NFS_CALLBACK_MAXPORTNR) |
2664 | return -EINVAL; | 2686 | return -EINVAL; |
2665 | *((unsigned int *)kp->arg) = num; | 2687 | *((unsigned int *)kp->arg) = num; |
@@ -2674,6 +2696,8 @@ static struct kernel_param_ops param_ops_portnr = { | |||
2674 | module_param_named(callback_tcpport, nfs_callback_set_tcpport, portnr, 0644); | 2696 | module_param_named(callback_tcpport, nfs_callback_set_tcpport, portnr, 0644); |
2675 | module_param(nfs_idmap_cache_timeout, int, 0644); | 2697 | module_param(nfs_idmap_cache_timeout, int, 0644); |
2676 | module_param(nfs4_disable_idmapping, bool, 0644); | 2698 | module_param(nfs4_disable_idmapping, bool, 0644); |
2699 | module_param_string(nfs4_unique_id, nfs4_client_id_uniquifier, | ||
2700 | NFS4_CLIENT_ID_UNIQ_LEN, 0600); | ||
2677 | MODULE_PARM_DESC(nfs4_disable_idmapping, | 2701 | MODULE_PARM_DESC(nfs4_disable_idmapping, |
2678 | "Turn off NFSv4 idmapping when using 'sec=sys'"); | 2702 | "Turn off NFSv4 idmapping when using 'sec=sys'"); |
2679 | module_param(max_session_slots, ushort, 0644); | 2703 | module_param(max_session_slots, ushort, 0644); |
@@ -2682,6 +2706,7 @@ MODULE_PARM_DESC(max_session_slots, "Maximum number of outstanding NFSv4.1 " | |||
2682 | module_param(send_implementation_id, ushort, 0644); | 2706 | module_param(send_implementation_id, ushort, 0644); |
2683 | MODULE_PARM_DESC(send_implementation_id, | 2707 | MODULE_PARM_DESC(send_implementation_id, |
2684 | "Send implementation ID with NFSv4.1 exchange_id"); | 2708 | "Send implementation ID with NFSv4.1 exchange_id"); |
2709 | MODULE_PARM_DESC(nfs4_unique_id, "nfs_client_id4 uniquifier string"); | ||
2685 | MODULE_ALIAS("nfs4"); | 2710 | MODULE_ALIAS("nfs4"); |
2686 | 2711 | ||
2687 | #endif /* CONFIG_NFS_V4 */ | 2712 | #endif /* CONFIG_NFS_V4 */ |