Commit a2db857b authored by tangwenji's avatar tangwenji Committed by Nicholas Bellinger

target: fix match_token option in target_core_configfs.c

The match_token function does not recognize the option 'l',
so that both the mapped_lun and target_lun parameters
can not be resolved correctly.

And parsed u64-type parameters should use match_u64().

(Use %u instead of %s for Opt_mapped_lun + Opt_target_lun - nab)
Signed-off-by: default avatartangwenji <tang.wenji@zte.com.cn>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent 79dd6f2f
...@@ -1611,12 +1611,12 @@ static match_table_t tokens = { ...@@ -1611,12 +1611,12 @@ static match_table_t tokens = {
{Opt_res_type, "res_type=%d"}, {Opt_res_type, "res_type=%d"},
{Opt_res_scope, "res_scope=%d"}, {Opt_res_scope, "res_scope=%d"},
{Opt_res_all_tg_pt, "res_all_tg_pt=%d"}, {Opt_res_all_tg_pt, "res_all_tg_pt=%d"},
{Opt_mapped_lun, "mapped_lun=%lld"}, {Opt_mapped_lun, "mapped_lun=%u"},
{Opt_target_fabric, "target_fabric=%s"}, {Opt_target_fabric, "target_fabric=%s"},
{Opt_target_node, "target_node=%s"}, {Opt_target_node, "target_node=%s"},
{Opt_tpgt, "tpgt=%d"}, {Opt_tpgt, "tpgt=%d"},
{Opt_port_rtpi, "port_rtpi=%d"}, {Opt_port_rtpi, "port_rtpi=%d"},
{Opt_target_lun, "target_lun=%lld"}, {Opt_target_lun, "target_lun=%u"},
{Opt_err, NULL} {Opt_err, NULL}
}; };
...@@ -1693,7 +1693,7 @@ static ssize_t target_pr_res_aptpl_metadata_store(struct config_item *item, ...@@ -1693,7 +1693,7 @@ static ssize_t target_pr_res_aptpl_metadata_store(struct config_item *item,
} }
break; break;
case Opt_sa_res_key: case Opt_sa_res_key:
ret = kstrtoull(args->from, 0, &tmp_ll); ret = match_u64(args, &tmp_ll);
if (ret < 0) { if (ret < 0) {
pr_err("kstrtoull() failed for sa_res_key=\n"); pr_err("kstrtoull() failed for sa_res_key=\n");
goto out; goto out;
...@@ -1727,10 +1727,10 @@ static ssize_t target_pr_res_aptpl_metadata_store(struct config_item *item, ...@@ -1727,10 +1727,10 @@ static ssize_t target_pr_res_aptpl_metadata_store(struct config_item *item,
all_tg_pt = (int)arg; all_tg_pt = (int)arg;
break; break;
case Opt_mapped_lun: case Opt_mapped_lun:
ret = match_int(args, &arg); ret = match_u64(args, &tmp_ll);
if (ret) if (ret)
goto out; goto out;
mapped_lun = (u64)arg; mapped_lun = (u64)tmp_ll;
break; break;
/* /*
* PR APTPL Metadata for Target Port * PR APTPL Metadata for Target Port
...@@ -1768,10 +1768,10 @@ static ssize_t target_pr_res_aptpl_metadata_store(struct config_item *item, ...@@ -1768,10 +1768,10 @@ static ssize_t target_pr_res_aptpl_metadata_store(struct config_item *item,
goto out; goto out;
break; break;
case Opt_target_lun: case Opt_target_lun:
ret = match_int(args, &arg); ret = match_u64(args, &tmp_ll);
if (ret) if (ret)
goto out; goto out;
target_lun = (u64)arg; target_lun = (u64)tmp_ll;
break; break;
default: default:
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment