Whamcloud - gitweb
LU-9767 utils: validate filesystem name for mkfs.lustre
The patch "LU-6401 uapi: turn lustre_param.h into a proper
UAPI header" removed various user land functions used to
validate poolnames and file system names were removed. The
checks instead were enforced on the kernel side to ensure
any possible user land software directly interfacing to the
kernel wouldn't be able to break things badly. For the case
of formating the backend file system no kernel interaction
doesn't happen until it tries to mount the MDT/OST/MGT which
is very late in the process. So for this case lets add back
the file system name verification to mkfs.lustre to warn
users long before they try to mount anything.
Secondly we remove the verify_poolname() in lfs.c since
it duplicates extract_fsname_poolname() in obd.c. Their
is no need to do the same test twice. The function
pool_cmd() calls the ioctl for pool handling which in
turn returns an error code. Use this error code to notify
the user what mistake they did for their pool command.
For the MGS kernel code mgs_extract_fs_pool() was checking
MTI_NAME_MAXLEN instead of LUSTRE_MAXFSNAME. Also use
LUSTRE_MAXFSNAME instead of the raw number in the function
server_name2fsname() located in obd_mount.c.
Change-Id: If094644e56a70b6dd8e6b0378adc8736911aeef1
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/28070
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>