Whamcloud - gitweb
LU-12722 target: disable recovery for local clients
[fs/lustre-release.git] / lustre / obdclass / llog_ioctl.c
index 6c88632..3db9ef5 100644 (file)
@@ -167,7 +167,7 @@ static int llog_check_cb(const struct lu_env *env, struct llog_handle *handle,
                        RETURN(rc);
                }
                rc = llog_process(env, loghandle, llog_check_cb, NULL, NULL);
-               llog_handle_put(loghandle);
+               llog_handle_put(env, loghandle);
        } else {
                bool ok;
 
@@ -292,7 +292,7 @@ static int llog_remove_log(const struct lu_env *env, struct llog_handle *cat,
        }
        llog_cat_cleanup(env, cat, log, log->u.phd.phd_cookie.lgc_index);
 out:
-       llog_handle_put(log);
+       llog_handle_put(env, log);
        RETURN(rc);
 
 }
@@ -318,12 +318,13 @@ int llog_ioctl(const struct lu_env *env, struct llog_ctxt *ctxt, int cmd,
        struct llog_logid logid;
        int rc = 0;
        struct llog_handle *handle = NULL;
-       char *logname;
+       char *logname, start;
 
        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);
@@ -331,8 +332,8 @@ int llog_ioctl(const struct lu_env *env, struct llog_ctxt *ctxt, int cmd,
                               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,
@@ -340,7 +341,10 @@ int llog_ioctl(const struct lu_env *env, struct llog_ctxt *ctxt, int cmd,
                if (rc)
                        RETURN(rc);
        } else {
-               RETURN(-EINVAL);
+               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);