Skip to content

Commit a2db857

Browse files
tangwenjiNicholas Bellinger
authored andcommitted
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: tangwenji <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
1 parent 79dd6f2 commit a2db857

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

drivers/target/target_core_configfs.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1611,12 +1611,12 @@ static match_table_t tokens = {
16111611
{Opt_res_type, "res_type=%d"},
16121612
{Opt_res_scope, "res_scope=%d"},
16131613
{Opt_res_all_tg_pt, "res_all_tg_pt=%d"},
1614-
{Opt_mapped_lun, "mapped_lun=%lld"},
1614+
{Opt_mapped_lun, "mapped_lun=%u"},
16151615
{Opt_target_fabric, "target_fabric=%s"},
16161616
{Opt_target_node, "target_node=%s"},
16171617
{Opt_tpgt, "tpgt=%d"},
16181618
{Opt_port_rtpi, "port_rtpi=%d"},
1619-
{Opt_target_lun, "target_lun=%lld"},
1619+
{Opt_target_lun, "target_lun=%u"},
16201620
{Opt_err, NULL}
16211621
};
16221622

@@ -1693,7 +1693,7 @@ static ssize_t target_pr_res_aptpl_metadata_store(struct config_item *item,
16931693
}
16941694
break;
16951695
case Opt_sa_res_key:
1696-
ret = kstrtoull(args->from, 0, &tmp_ll);
1696+
ret = match_u64(args, &tmp_ll);
16971697
if (ret < 0) {
16981698
pr_err("kstrtoull() failed for sa_res_key=\n");
16991699
goto out;
@@ -1727,10 +1727,10 @@ static ssize_t target_pr_res_aptpl_metadata_store(struct config_item *item,
17271727
all_tg_pt = (int)arg;
17281728
break;
17291729
case Opt_mapped_lun:
1730-
ret = match_int(args, &arg);
1730+
ret = match_u64(args, &tmp_ll);
17311731
if (ret)
17321732
goto out;
1733-
mapped_lun = (u64)arg;
1733+
mapped_lun = (u64)tmp_ll;
17341734
break;
17351735
/*
17361736
* PR APTPL Metadata for Target Port
@@ -1768,10 +1768,10 @@ static ssize_t target_pr_res_aptpl_metadata_store(struct config_item *item,
17681768
goto out;
17691769
break;
17701770
case Opt_target_lun:
1771-
ret = match_int(args, &arg);
1771+
ret = match_u64(args, &tmp_ll);
17721772
if (ret)
17731773
goto out;
1774-
target_lun = (u64)arg;
1774+
target_lun = (u64)tmp_ll;
17751775
break;
17761776
default:
17771777
break;

0 commit comments

Comments
 (0)