The lsnapshot utility creates filesystems named with generated
hexadecimal strings. In some cases the filesystem name may start
with a number instead of a character, which causes "lctl llog_print"
(via llog_ioctl()) to consider the filesystem name invalid.
Allow filesystem names in llog_ioctl() to start with a digit.
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Ib2054d5afbeaa3f661148fff834c29f83f5d98ad
Reviewed-on: https://review.whamcloud.com/36414
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Nathaniel Clark <nclark@whamcloud.com>
Reviewed-by: Ben Evans <bevans@cray.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
struct llog_logid logid;
int rc = 0;
struct llog_handle *handle = NULL;
struct llog_logid logid;
int rc = 0;
struct llog_handle *handle = NULL;
ENTRY;
logname = data->ioc_inlbuf1;
ENTRY;
logname = data->ioc_inlbuf1;
- if (logname[0] == '#' || logname[0] == '[') {
+ start = logname[0];
+ if (start == '#' || start == '[') {
rc = str2logid(&logid, logname, data->ioc_inllen1);
if (rc)
RETURN(rc);
rc = str2logid(&logid, logname, data->ioc_inllen1);
if (rc)
RETURN(rc);
LLOG_OPEN_EXISTS);
if (rc)
RETURN(rc);
LLOG_OPEN_EXISTS);
if (rc)
RETURN(rc);
- } else if (logname[0] == '$' || isalpha(logname[0])) {
- if (logname[0] == '$')
+ } else if (start == '$' || isalpha(start) || isdigit(start)) {
+ if (start == '$')
logname++;
rc = llog_open(env, ctxt, &handle, NULL, logname,
logname++;
rc = llog_open(env, ctxt, &handle, NULL, logname,
if (rc)
RETURN(rc);
} else {
if (rc)
RETURN(rc);
} else {
+ rc = -EINVAL;
+ CDEBUG(D_INFO, "%s: invalid log name '%s': rc = %d\n",
+ ctxt->loc_obd->obd_name, logname, rc);
+ RETURN(rc);
}
rc = llog_init_handle(env, handle, 0, NULL);
}
rc = llog_init_handle(env, handle, 0, NULL);