diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-11 19:39:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-11 19:39:11 -0400 |
commit | 86d710146fb9975f04c505ec78caa43d227c1018 (patch) | |
tree | c7f95412b7760e6b7e3c15eab8b2ac944256d7ac /Documentation | |
parent | 86373435d2299b722ec87c416005953215f049c1 (diff) | |
parent | ab3bbaa8b257845e248e9a01d12a69ca245f4197 (diff) |
Merge git://git.linux-nfs.org/projects/trondmy/nfs-2.6
* git://git.linux-nfs.org/projects/trondmy/nfs-2.6: (87 commits)
NFSv4: Disallow 'mount -t nfs4 -overs=2' and 'mount -t nfs4 -overs=3'
NFS: Allow the "nfs" file system type to support NFSv4
NFS: Move details of nfs4_get_sb() to a helper
NFS: Refactor NFSv4 text-based mount option validation
NFS: Mount option parser should detect missing "port="
NFS: out of date comment regarding O_EXCL above nfs3_proc_create()
NFS: Handle a zero-length auth flavor list
SUNRPC: Ensure that sunrpc gets initialised before nfs, lockd, etc...
nfs: fix compile error in rpc_pipefs.h
nfs: Remove reference to generic_osync_inode from a comment
SUNRPC: cache must take a reference to the cache detail's module on open()
NFS: Use the DNS resolver in the mount code.
NFS: Add a dns resolver for use with NFSv4 referrals and migration
SUNRPC: Fix a typo in cache_pipefs_files
nfs: nfs4xdr: optimize low level decoding
nfs: nfs4xdr: get rid of READ_BUF
nfs: nfs4xdr: simplify decode_exchange_id by reusing decode_opaque_inline
nfs: nfs4xdr: get rid of COPYMEM
nfs: nfs4xdr: introduce decode_sessionid helper
nfs: nfs4xdr: introduce decode_verifier helper
...
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/filesystems/nfs.txt | 98 | ||||
-rw-r--r-- | Documentation/kernel-parameters.txt | 29 |
2 files changed, 127 insertions, 0 deletions
diff --git a/Documentation/filesystems/nfs.txt b/Documentation/filesystems/nfs.txt new file mode 100644 index 000000000000..f50f26ce6cd0 --- /dev/null +++ b/Documentation/filesystems/nfs.txt | |||
@@ -0,0 +1,98 @@ | |||
1 | |||
2 | The NFS client | ||
3 | ============== | ||
4 | |||
5 | The NFS version 2 protocol was first documented in RFC1094 (March 1989). | ||
6 | Since then two more major releases of NFS have been published, with NFSv3 | ||
7 | being documented in RFC1813 (June 1995), and NFSv4 in RFC3530 (April | ||
8 | 2003). | ||
9 | |||
10 | The Linux NFS client currently supports all the above published versions, | ||
11 | and work is in progress on adding support for minor version 1 of the NFSv4 | ||
12 | protocol. | ||
13 | |||
14 | The purpose of this document is to provide information on some of the | ||
15 | upcall interfaces that are used in order to provide the NFS client with | ||
16 | some of the information that it requires in order to fully comply with | ||
17 | the NFS spec. | ||
18 | |||
19 | The DNS resolver | ||
20 | ================ | ||
21 | |||
22 | NFSv4 allows for one server to refer the NFS client to data that has been | ||
23 | migrated onto another server by means of the special "fs_locations" | ||
24 | attribute. See | ||
25 | http://tools.ietf.org/html/rfc3530#section-6 | ||
26 | and | ||
27 | http://tools.ietf.org/html/draft-ietf-nfsv4-referrals-00 | ||
28 | |||
29 | The fs_locations information can take the form of either an ip address and | ||
30 | a path, or a DNS hostname and a path. The latter requires the NFS client to | ||
31 | do a DNS lookup in order to mount the new volume, and hence the need for an | ||
32 | upcall to allow userland to provide this service. | ||
33 | |||
34 | Assuming that the user has the 'rpc_pipefs' filesystem mounted in the usual | ||
35 | /var/lib/nfs/rpc_pipefs, the upcall consists of the following steps: | ||
36 | |||
37 | (1) The process checks the dns_resolve cache to see if it contains a | ||
38 | valid entry. If so, it returns that entry and exits. | ||
39 | |||
40 | (2) If no valid entry exists, the helper script '/sbin/nfs_cache_getent' | ||
41 | (may be changed using the 'nfs.cache_getent' kernel boot parameter) | ||
42 | is run, with two arguments: | ||
43 | - the cache name, "dns_resolve" | ||
44 | - the hostname to resolve | ||
45 | |||
46 | (3) After looking up the corresponding ip address, the helper script | ||
47 | writes the result into the rpc_pipefs pseudo-file | ||
48 | '/var/lib/nfs/rpc_pipefs/cache/dns_resolve/channel' | ||
49 | in the following (text) format: | ||
50 | |||
51 | "<ip address> <hostname> <ttl>\n" | ||
52 | |||
53 | Where <ip address> is in the usual IPv4 (123.456.78.90) or IPv6 | ||
54 | (ffee:ddcc:bbaa:9988:7766:5544:3322:1100, ffee::1100, ...) format. | ||
55 | <hostname> is identical to the second argument of the helper | ||
56 | script, and <ttl> is the 'time to live' of this cache entry (in | ||
57 | units of seconds). | ||
58 | |||
59 | Note: If <ip address> is invalid, say the string "0", then a negative | ||
60 | entry is created, which will cause the kernel to treat the hostname | ||
61 | as having no valid DNS translation. | ||
62 | |||
63 | |||
64 | |||
65 | |||
66 | A basic sample /sbin/nfs_cache_getent | ||
67 | ===================================== | ||
68 | |||
69 | #!/bin/bash | ||
70 | # | ||
71 | ttl=600 | ||
72 | # | ||
73 | cut=/usr/bin/cut | ||
74 | getent=/usr/bin/getent | ||
75 | rpc_pipefs=/var/lib/nfs/rpc_pipefs | ||
76 | # | ||
77 | die() | ||
78 | { | ||
79 | echo "Usage: $0 cache_name entry_name" | ||
80 | exit 1 | ||
81 | } | ||
82 | |||
83 | [ $# -lt 2 ] && die | ||
84 | cachename="$1" | ||
85 | cache_path=${rpc_pipefs}/cache/${cachename}/channel | ||
86 | |||
87 | case "${cachename}" in | ||
88 | dns_resolve) | ||
89 | name="$2" | ||
90 | result="$(${getent} hosts ${name} | ${cut} -f1 -d\ )" | ||
91 | [ -z "${result}" ] && result="0" | ||
92 | ;; | ||
93 | *) | ||
94 | die | ||
95 | ;; | ||
96 | esac | ||
97 | echo "${result} ${name} ${ttl}" >${cache_path} | ||
98 | |||
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 8e91863190e8..5d4427d17281 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -1503,6 +1503,14 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1503 | [NFS] set the TCP port on which the NFSv4 callback | 1503 | [NFS] set the TCP port on which the NFSv4 callback |
1504 | channel should listen. | 1504 | channel should listen. |
1505 | 1505 | ||
1506 | nfs.cache_getent= | ||
1507 | [NFS] sets the pathname to the program which is used | ||
1508 | to update the NFS client cache entries. | ||
1509 | |||
1510 | nfs.cache_getent_timeout= | ||
1511 | [NFS] sets the timeout after which an attempt to | ||
1512 | update a cache entry is deemed to have failed. | ||
1513 | |||
1506 | nfs.idmap_cache_timeout= | 1514 | nfs.idmap_cache_timeout= |
1507 | [NFS] set the maximum lifetime for idmapper cache | 1515 | [NFS] set the maximum lifetime for idmapper cache |
1508 | entries. | 1516 | entries. |
@@ -2395,6 +2403,18 @@ and is between 256 and 4096 characters. It is defined in the file | |||
2395 | stifb= [HW] | 2403 | stifb= [HW] |
2396 | Format: bpp:<bpp1>[:<bpp2>[:<bpp3>...]] | 2404 | Format: bpp:<bpp1>[:<bpp2>[:<bpp3>...]] |
2397 | 2405 | ||
2406 | sunrpc.min_resvport= | ||
2407 | sunrpc.max_resvport= | ||
2408 | [NFS,SUNRPC] | ||
2409 | SunRPC servers often require that client requests | ||
2410 | originate from a privileged port (i.e. a port in the | ||
2411 | range 0 < portnr < 1024). | ||
2412 | An administrator who wishes to reserve some of these | ||
2413 | ports for other uses may adjust the range that the | ||
2414 | kernel's sunrpc client considers to be privileged | ||
2415 | using these two parameters to set the minimum and | ||
2416 | maximum port values. | ||
2417 | |||
2398 | sunrpc.pool_mode= | 2418 | sunrpc.pool_mode= |
2399 | [NFS] | 2419 | [NFS] |
2400 | Control how the NFS server code allocates CPUs to | 2420 | Control how the NFS server code allocates CPUs to |
@@ -2411,6 +2431,15 @@ and is between 256 and 4096 characters. It is defined in the file | |||
2411 | pernode one pool for each NUMA node (equivalent | 2431 | pernode one pool for each NUMA node (equivalent |
2412 | to global on non-NUMA machines) | 2432 | to global on non-NUMA machines) |
2413 | 2433 | ||
2434 | sunrpc.tcp_slot_table_entries= | ||
2435 | sunrpc.udp_slot_table_entries= | ||
2436 | [NFS,SUNRPC] | ||
2437 | Sets the upper limit on the number of simultaneous | ||
2438 | RPC calls that can be sent from the client to a | ||
2439 | server. Increasing these values may allow you to | ||
2440 | improve throughput, but will also increase the | ||
2441 | amount of memory reserved for use by the client. | ||
2442 | |||
2414 | swiotlb= [IA-64] Number of I/O TLB slabs | 2443 | swiotlb= [IA-64] Number of I/O TLB slabs |
2415 | 2444 | ||
2416 | switches= [HW,M68k] | 2445 | switches= [HW,M68k] |