Whamcloud - gitweb
LU-4219 mdd: limit os_namelen to the max of NAME_MAX 17/8217/2
authorJian Yu <jian.yu@intel.com>
Fri, 8 Nov 2013 07:18:34 +0000 (15:18 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 14 Nov 2013 01:32:29 +0000 (01:32 +0000)
commit7d197837e0d7eb5f40a928a8f6c57270493b8996
tree95d7ad593c5053947443faebacbb250b5c89e6e4
parent0ec1dbbea450375af070838ce6487e14c6595c83
LU-4219 mdd: limit os_namelen to the max of NAME_MAX

While running pathconf(".", _PC_NAME_MAX) on ldiskfs-based
Lustre filesystem, it returns 255 (NAME_MAX). However, on
zfs-based Lustre filesystem, it returns 256 (MAXNAMELEN).
Since Lustre can not handle the name length large than
NAME_MAX, this patch limits the value of os_namelen in
mdd_statfs() to the max of NAME_MAX.

Test-Parameters: envdefinitions=SLOW=yes \
mdtfilesystemtype=zfs mdsfilesystemtype=zfs ostfilesystemtype=zfs \
ostcount=2 testlist=posix

Signed-off-by: Jian Yu <jian.yu@intel.com>
Change-Id: I13b5398eff5b15c74b0e08e2a3394b79a3ff6a44
Reviewed-on: http://review.whamcloud.com/8217
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/mdd/mdd_device.c