Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

SUNRPC/NFS: Add Kbuild dependencies for NFS_DEBUG/RPC_DEBUG

This allows us to turn on/off the dprintk() debugging interfaces for
those distributions that don't ship the 'rpcdebug' utility.
It also allows us to add Kbuild dependencies. Specifically, we already
know that dprintk() in general relies on CONFIG_SYSCTL. Now it turns out
that the NFS dprintks depend on CONFIG_CRC32 after we added support
for the filehandle hash.

Reported-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

+31 -13
+6
fs/nfs/Kconfig
··· 144 144 depends on NFS_V4 && !NFS_USE_LEGACY_DNS 145 145 select DNS_RESOLVER 146 146 default y 147 + 148 + config NFS_DEBUG 149 + bool 150 + depends on NFS_FS && SUNRPC_DEBUG 151 + select CRC32 152 + default y
+1 -1
fs/nfs/inode.c
··· 1047 1047 return fh; 1048 1048 } 1049 1049 1050 - #ifdef RPC_DEBUG 1050 + #ifdef NFS_DEBUG 1051 1051 /* 1052 1052 * _nfs_display_fhandle_hash - calculate the crc32 hash for the filehandle 1053 1053 * in the same way that wireshark does
+1 -1
fs/nfs/mount_clnt.c
··· 16 16 #include <linux/nfs_fs.h> 17 17 #include "internal.h" 18 18 19 - #ifdef RPC_DEBUG 19 + #ifdef NFS_DEBUG 20 20 # define NFSDBG_FACILITY NFSDBG_MOUNT 21 21 #endif 22 22
+1 -1
fs/nfs/nfsroot.c
··· 104 104 /* server:export path string passed to super.c */ 105 105 static char nfs_root_device[NFS_MAXPATHLEN + 1] __initdata = ""; 106 106 107 - #ifdef RPC_DEBUG 107 + #ifdef NFS_DEBUG 108 108 /* 109 109 * When the "nfsrootdebug" kernel command line option is specified, 110 110 * enable debugging messages for NFSROOT.
+8 -9
include/linux/nfs_fs.h
··· 38 38 39 39 #ifdef __KERNEL__ 40 40 41 + /* 42 + * Enable dprintk() debugging support for nfs client. 43 + */ 44 + #ifdef CONFIG_NFS_DEBUG 45 + # define NFS_DEBUG 46 + #endif 47 + 41 48 #include <linux/in.h> 42 49 #include <linux/mm.h> 43 50 #include <linux/pagemap.h> ··· 398 391 kfree(fh); 399 392 } 400 393 401 - #ifdef RPC_DEBUG 394 + #ifdef NFS_DEBUG 402 395 extern u32 _nfs_display_fhandle_hash(const struct nfs_fh *fh); 403 396 static inline u32 nfs_display_fhandle_hash(const struct nfs_fh *fh) 404 397 { ··· 656 649 #define NFSDBG_ALL 0xFFFF 657 650 658 651 #ifdef __KERNEL__ 659 - 660 - /* 661 - * Enable debugging support for nfs client. 662 - * Requires RPC_DEBUG. 663 - */ 664 - #ifdef RPC_DEBUG 665 - # define NFS_DEBUG 666 - #endif 667 652 668 653 # undef ifdebug 669 654 # ifdef NFS_DEBUG
+1 -1
include/linux/sunrpc/debug.h
··· 31 31 /* 32 32 * Enable RPC debugging/profiling. 33 33 */ 34 - #ifdef CONFIG_SYSCTL 34 + #ifdef CONFIG_SUNRPC_DEBUG 35 35 #define RPC_DEBUG 36 36 #endif 37 37 #ifdef CONFIG_TRACEPOINTS
+13
net/sunrpc/Kconfig
··· 39 39 Kerberos support should be installed. 40 40 41 41 If unsure, say Y. 42 + 43 + config SUNRPC_DEBUG 44 + bool "RPC: Enable dprintk debugging" 45 + depends on SUNRPC && SYSCTL 46 + help 47 + This option enables a sysctl-based debugging interface 48 + that is be used by the 'rpcdebug' utility to turn on or off 49 + logging of different aspects of the kernel RPC activity. 50 + 51 + Disabling this option will make your kernel slightly smaller, 52 + but makes troubleshooting NFS issues significantly harder. 53 + 54 + If unsure, say Y.