linux/fs/nfs
Chuck Lever 02a2976c91 NFS: Clean up debugging in decode_pathname()
I noticed recently that decode_attr_fs_locations() is not generating
very pretty debugging output.  The pathname components each appear on
a separate line of output, though that does not appear to be the
intended display behavior.  The preferred way to generate continued
lines of output on the console is to use pr_cont().

Note that incoming pathname4 components contain a string that is not
necessarily NUL-terminated.  I did actually see some trailing garbage
on the console.  In addition to correcting the line continuation
problem, add a string precision format specifier to ensure that each
component string is displayed properly, and that vsnprintf() does
not Oops.

Someone pointed out that allowing incoming network data to possibly
generate a console line of unbounded length may not be such a good
idea.  Since this output will rarely be enabled, and there is a hard
upper bound (NFS4_PATHNAME_MAXCOMPONENTS) in our implementation, this
is probably not a major concern.

It might be useful to additionally sanity-check the length of each
incoming component, however.  RFC 3530bis15 does not suggest a maximum
number of UTF-8 characters per component for either the pathname4 or
component4 types.  However, we could invent one that is appropriate
for our implementation.

Another possibility is to scrap all of this and print these pathnames
in upper layers after a reasonable amount of sanity checking in the
XDR layer.  This would give us an opportunity to allocate a full
buffer so that the whole pathname would be output via a single
dprintk.

Introduced by commit 7aaa0b3b: "NFSv4: convert fs-locations-components
to conform to RFC3530," (June 9, 2006).

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-03-02 15:36:26 -05:00
..
blocklayout NFS: start printks w/ NFS: even if __func__ shown 2012-02-06 18:48:00 -05:00
objlayout NFS: start printks w/ NFS: even if __func__ shown 2012-02-06 18:48:00 -05:00
cache_lib.c NFS: remove RPC PipeFS mount point references from NFS cache routines 2012-01-31 18:20:26 -05:00
cache_lib.h NFS: DNS resolver PipeFS notifier introduced 2012-01-31 18:20:26 -05:00
callback.c NFS: start printks w/ NFS: even if __func__ shown 2012-02-06 18:48:00 -05:00
callback.h NFSv4.1: Convert slotid from u8 to u32 2012-02-15 00:19:43 -05:00
callback_proc.c NFSv4.1: Get rid of NFS4CLNT_LAYOUTRECALL 2012-03-01 11:17:50 -05:00
callback_xdr.c NFSv4.1: Convert slotid from u8 to u32 2012-02-15 00:19:43 -05:00
client.c NFSv4: parse and display server implementation ids 2012-03-01 17:10:22 -05:00
delegation.c NFS: Use the inode->i_version to cache NFSv4 change attribute information 2011-10-18 09:14:34 -07:00
delegation.h NFS: Move cl_delegations to the nfs_server struct 2011-01-06 14:57:46 -05:00
dir.c NFS: Make nfs_cache_array.size a signed integer 2012-03-02 15:36:13 -05:00
direct.c atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
dns_resolve.c NFS: pass proper net rpc_pton() in nfs_dns_resolve_name() 2012-02-06 18:48:04 -05:00
dns_resolve.h NFS: DNS resolver cache per network namespace context introduced 2012-01-31 18:20:26 -05:00
file.c NFS: Ensure that mmapped pages remain stable during writeback 2012-01-31 19:28:08 -05:00
fscache-index.c NFS: Use the inode->i_version to cache NFSv4 change attribute information 2011-10-18 09:14:34 -07:00
fscache.c FS-Cache: Add a helper to bulk uncache pages on an inode 2011-07-07 13:21:56 -07:00
fscache.h NFS: Propagate 'fsc' mount option through automounts 2009-09-23 14:36:39 -04:00
getroot.c Merge branch 'nfs-for-2.6.39' into nfs-for-next 2011-03-24 17:03:14 -04:00
idmap.c NFS: Store the legacy idmapper result in the keyring 2012-03-01 17:10:16 -05:00
inode.c NFS: make cb_ident_idr per net ns 2012-02-06 18:48:03 -05:00
internal.h NFS: search for client session id in proper network namespace 2012-02-06 18:48:04 -05:00
iostat.h NFS: Squelch compiler warning in nfs_add_server_stats() 2010-05-14 15:09:31 -04:00
Kconfig NFSv4: Send implementation id with exchange_id 2012-03-01 17:10:21 -05:00
Makefile pnfsblock: add blocklayout Kconfig option, Makefile, and stubs 2011-07-31 12:18:15 -04:00
mount_clnt.c SUNRPC: constify the rpc_program 2012-01-31 19:28:20 -05:00
namespace.c nfs: Clean up debugging in nfs_follow_mountpoint() 2012-02-16 15:05:16 -05:00
netns.h NFS: make nfs_client_lock per net ns 2012-02-06 18:48:03 -05:00
nfs2xdr.c SUNRPC: constify the rpc_program 2012-01-31 19:28:20 -05:00
nfs3acl.c switch posix_acl_create() to umode_t * 2011-08-01 02:09:42 -04:00
nfs3proc.c Freezer / sunrpc / NFS: don't allow TASK_KILLABLE sleeps to block the freezer 2011-12-06 22:12:27 +01:00
nfs3xdr.c SUNRPC: constify the rpc_program 2012-01-31 19:28:20 -05:00
nfs4_fs.h NFSv4.1: Get rid of NFS4CLNT_LAYOUTRECALL 2012-03-01 11:17:50 -05:00
nfs4filelayout.c NFS: include filelayout DS rpc stats in mountstats 2012-02-17 13:39:47 -05:00
nfs4filelayout.h NFSv4.1: do not use deviceids after MDS clientid invalidation 2011-07-12 13:40:29 -04:00
nfs4filelayoutdev.c NFS: Fix comparison between DS address lists 2012-02-06 18:48:00 -05:00
nfs4namespace.c NFS: pass transport net to rpc_pton() while parse server name 2012-02-06 18:48:05 -05:00
nfs4proc.c NFSv4: parse and display server implementation ids 2012-03-01 17:10:22 -05:00
nfs4renewd.c NFSv4: The NFSv4.0 client must send RENEW calls if it holds a delegation 2011-08-24 15:07:37 -04:00
nfs4state.c NFSv4.1 set highest_used_slotid to NFS4_NO_SLOT 2012-02-17 13:38:03 -05:00
nfs4xdr.c NFS: Clean up debugging in decode_pathname() 2012-03-02 15:36:26 -05:00
nfsroot.c NFS: Revert NFSROOT default mount options 2011-05-27 17:42:47 -04:00
pagelist.c NFS: Remove unnecessary includes from linux/nfs_fs_i.h 2012-01-31 18:20:28 -05:00
pnfs.c NFSv4.1: Get rid of redundant NFS4CLNT_LAYOUTRECALL tests 2012-03-01 11:17:47 -05:00
pnfs.h NFSv4.1: Don't call nfs4_deviceid_purge_client() unless we're NFSv4.1 2012-02-26 17:34:22 -05:00
pnfs_dev.c fs: add export.h to files using EXPORT_SYMBOL/THIS_MODULE macros 2011-10-31 19:30:31 -04:00
proc.c Freezer / sunrpc / NFS: don't allow TASK_KILLABLE sleeps to block the freezer 2011-12-06 22:12:27 +01:00
read.c NFSv41: Add a new helper nfs4_init_sequence() 2012-01-31 19:28:06 -05:00
super.c NFS: Consolidate the parsing of the '-ov4.x' and '-overs=4.x' mount options 2012-03-02 14:06:39 -05:00
symlink.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
sysctl.c NFS: Fall back on old idmapper if request_key() fails 2012-02-06 18:48:01 -05:00
unlink.c NFSv41: Add a new helper nfs4_init_sequence() 2012-01-31 19:28:06 -05:00
write.c NFSv41: Add a new helper nfs4_init_sequence() 2012-01-31 19:28:06 -05:00