From: Andreas Dilger Date: Thu, 10 Nov 2016 17:30:56 +0000 (-0500) Subject: staging: lustre: mdc: remove console spew from mdc_ioc_fid2path X-Git-Tag: v4.14-rc1~1919^2~263 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6bf18cd3b3e0ce5995b55dcb5b7005fe18523d8b;p=platform%2Fkernel%2Flinux-rpi3.git staging: lustre: mdc: remove console spew from mdc_ioc_fid2path In some cases with a very long pathname, such as with sanity.sh test_154c, mdc_ioc_fid2path() would spew long debug messages to the log, because libcfs_debug_vmsg2() refuses to log messages over one page in size. Truncate the debug message to only log the last 512 characters of the pathname, which is sufficient for most debugging, saves a bit of space in the debug log, and will prevent the debug logging from printing to the console in the first place. Signed-off-by: Andreas Dilger Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-1095 Reviewed-on: http://review.whamcloud.com/17078 Reviewed-by: Jian Yu Reviewed-by: Niu Yawei Reviewed-by: Oleg Drokin Signed-off-by: James Simmons Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c index c620f5c..bfc3b51 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_request.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c @@ -1453,8 +1453,11 @@ static int mdc_ioc_fid2path(struct obd_export *exp, struct getinfo_fid2path *gf) goto out; } - CDEBUG(D_IOCTL, "path get "DFID" from %llu #%d\n%s\n", - PFID(&gf->gf_fid), gf->gf_recno, gf->gf_linkno, gf->gf_path); + CDEBUG(D_IOCTL, "path got " DFID " from %llu #%d: %s\n", + PFID(&gf->gf_fid), gf->gf_recno, gf->gf_linkno, + gf->gf_pathlen < 512 ? gf->gf_path : + /* only log the last 512 characters of the path */ + gf->gf_path + gf->gf_pathlen - 512); out: kfree(key);