aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2010-09-17 10:54:37 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2010-09-17 10:54:37 -0400
commit306a075362a288683f6346185f97dd0e06df19da (patch)
treebcade14a2a0b634c5bf64eab87db8219d8d6981c
parent8d2321037896aa4868a67f45b2d6ed52b579a48a (diff)
NFS: Allow NFSROOT debugging messages to be enabled dynamically
As a convenience, introduce a kernel command line option to enable NFSROOT debugging messages. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--Documentation/filesystems/nfs/nfsroot.txt22
-rw-r--r--Documentation/kernel-parameters.txt5
-rw-r--r--fs/nfs/nfsroot.c19
3 files changed, 39 insertions, 7 deletions
diff --git a/Documentation/filesystems/nfs/nfsroot.txt b/Documentation/filesystems/nfs/nfsroot.txt
index f2430a7974e1..90c71c6f0d00 100644
--- a/Documentation/filesystems/nfs/nfsroot.txt
+++ b/Documentation/filesystems/nfs/nfsroot.txt
@@ -159,6 +159,28 @@ ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>
159 Default: any 159 Default: any
160 160
161 161
162nfsrootdebug
163
164 This parameter enables debugging messages to appear in the kernel
165 log at boot time so that administrators can verify that the correct
166 NFS mount options, server address, and root path are passed to the
167 NFS client.
168
169
170rdinit=<executable file>
171
172 To specify which file contains the program that starts system
173 initialization, administrators can use this command line parameter.
174 The default value of this parameter is "/init". If the specified
175 file exists and the kernel can execute it, root filesystem related
176 kernel command line parameters, including `nfsroot=', are ignored.
177
178 A description of the process of mounting the root file system can be
179 found in:
180
181 Documentation/early-userspace/README
182
183
162 184
163 185
1643.) Boot Loader 1863.) Boot Loader
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index f084af0cb8e0..0fe70b2c4194 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1532,12 +1532,15 @@ and is between 256 and 4096 characters. It is defined in the file
1532 1 to enable accounting 1532 1 to enable accounting
1533 Default value is 0. 1533 Default value is 0.
1534 1534
1535 nfsaddrs= [NFS] 1535 nfsaddrs= [NFS] Deprecated. Use ip= instead.
1536 See Documentation/filesystems/nfs/nfsroot.txt. 1536 See Documentation/filesystems/nfs/nfsroot.txt.
1537 1537
1538 nfsroot= [NFS] nfs root filesystem for disk-less boxes. 1538 nfsroot= [NFS] nfs root filesystem for disk-less boxes.
1539 See Documentation/filesystems/nfs/nfsroot.txt. 1539 See Documentation/filesystems/nfs/nfsroot.txt.
1540 1540
1541 nfsrootdebug [NFS] enable nfsroot debugging messages.
1542 See Documentation/filesystems/nfs/nfsroot.txt.
1543
1541 nfs.callback_tcpport= 1544 nfs.callback_tcpport=
1542 [NFS] set the TCP port on which the NFSv4 callback 1545 [NFS] set the TCP port on which the NFSv4 callback
1543 channel should listen. 1546 channel should listen.
diff --git a/fs/nfs/nfsroot.c b/fs/nfs/nfsroot.c
index 8e7d623173a9..460df3652889 100644
--- a/fs/nfs/nfsroot.c
+++ b/fs/nfs/nfsroot.c
@@ -67,6 +67,7 @@
67 * NFS over TCP. 67 * NFS over TCP.
68 * Fabian Frederick: Option parser rebuilt (using parser lib) 68 * Fabian Frederick: Option parser rebuilt (using parser lib)
69 * Chuck Lever : Use super.c's text-based mount option parsing 69 * Chuck Lever : Use super.c's text-based mount option parsing
70 * Chuck Lever : Add "nfsrootdebug".
70 */ 71 */
71 72
72#include <linux/types.h> 73#include <linux/types.h>
@@ -80,8 +81,6 @@
80 81
81#include "internal.h" 82#include "internal.h"
82 83
83/* Define this to allow debugging output */
84#undef NFSROOT_DEBUG
85#define NFSDBG_FACILITY NFSDBG_ROOT 84#define NFSDBG_FACILITY NFSDBG_ROOT
86 85
87/* Default path we try to mount. "%s" gets replaced by our IP address */ 86/* Default path we try to mount. "%s" gets replaced by our IP address */
@@ -103,6 +102,18 @@ static char nfs_export_path[NFS_MAXPATHLEN + 1] __initdata = "";
103static char nfs_root_device[NFS_MAXPATHLEN + 1] __initdata = ""; 102static char nfs_root_device[NFS_MAXPATHLEN + 1] __initdata = "";
104 103
105/* 104/*
105 * When the "nfsrootdebug" kernel command line option is specified,
106 * enable debugging messages for NFSROOT.
107 */
108static int __init nfs_root_debug(char *__unused)
109{
110 nfs_debug |= NFSDBG_ROOT | NFSDBG_MOUNT;
111 return 1;
112}
113
114__setup("nfsrootdebug", nfs_root_debug);
115
116/*
106 * Parse NFS server and directory information passed on the kernel 117 * Parse NFS server and directory information passed on the kernel
107 * command line. 118 * command line.
108 * 119 *
@@ -282,10 +293,6 @@ out_devnametoolong:
282 */ 293 */
283int __init nfs_root_data(char **root_device, char **root_data) 294int __init nfs_root_data(char **root_device, char **root_data)
284{ 295{
285#ifdef NFSROOT_DEBUG
286 nfs_debug |= NFSDBG_ROOT | NFSDBG_MOUNT;
287#endif /* NFSROOT_DEBUG */
288
289 servaddr = root_server_addr; 296 servaddr = root_server_addr;
290 if (servaddr == htonl(INADDR_NONE)) { 297 if (servaddr == htonl(INADDR_NONE)) {
291 printk(KERN_ERR "Root-NFS: no NFS server address\n"); 298 printk(KERN_ERR "Root-NFS: no NFS server address\n");