Commit 306a075362a288683f6346185f97dd0e06df19da
Committed by
Trond Myklebust
1 parent
8d23210378
Exists in
master
and in
4 other branches
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>
Showing 3 changed files with 39 additions and 7 deletions Side-by-side Diff
Documentation/filesystems/nfs/nfsroot.txt
... | ... | @@ -159,6 +159,28 @@ |
159 | 159 | Default: any |
160 | 160 | |
161 | 161 | |
162 | +nfsrootdebug | |
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 | + | |
170 | +rdinit=<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 | |
164 | 186 | 3.) Boot Loader |
Documentation/kernel-parameters.txt
... | ... | @@ -1532,10 +1532,13 @@ |
1532 | 1532 | 1 to enable accounting |
1533 | 1533 | Default value is 0. |
1534 | 1534 | |
1535 | - nfsaddrs= [NFS] | |
1535 | + nfsaddrs= [NFS] Deprecated. Use ip= instead. | |
1536 | 1536 | See Documentation/filesystems/nfs/nfsroot.txt. |
1537 | 1537 | |
1538 | 1538 | nfsroot= [NFS] nfs root filesystem for disk-less boxes. |
1539 | + See Documentation/filesystems/nfs/nfsroot.txt. | |
1540 | + | |
1541 | + nfsrootdebug [NFS] enable nfsroot debugging messages. | |
1539 | 1542 | See Documentation/filesystems/nfs/nfsroot.txt. |
1540 | 1543 | |
1541 | 1544 | nfs.callback_tcpport= |
fs/nfs/nfsroot.c
... | ... | @@ -67,6 +67,7 @@ |
67 | 67 | * NFS over TCP. |
68 | 68 | * Fabian Frederick: Option parser rebuilt (using parser lib) |
69 | 69 | * Chuck Lever : Use super.c's text-based mount option parsing |
70 | + * Chuck Lever : Add "nfsrootdebug". | |
70 | 71 | */ |
71 | 72 | |
72 | 73 | #include <linux/types.h> |
... | ... | @@ -80,8 +81,6 @@ |
80 | 81 | |
81 | 82 | #include "internal.h" |
82 | 83 | |
83 | -/* Define this to allow debugging output */ | |
84 | -#undef NFSROOT_DEBUG | |
85 | 84 | #define NFSDBG_FACILITY NFSDBG_ROOT |
86 | 85 | |
87 | 86 | /* Default path we try to mount. "%s" gets replaced by our IP address */ |
... | ... | @@ -103,6 +102,18 @@ |
103 | 102 | static 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 | + */ | |
108 | +static 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 | 117 | * Parse NFS server and directory information passed on the kernel |
107 | 118 | * command line. |
108 | 119 | * |
... | ... | @@ -282,10 +293,6 @@ |
282 | 293 | */ |
283 | 294 | int __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 | 296 | servaddr = root_server_addr; |
290 | 297 | if (servaddr == htonl(INADDR_NONE)) { |
291 | 298 | printk(KERN_ERR "Root-NFS: no NFS server address\n"); |