Commit 0877eafd authored by Sebastian Andrzej Siewior's avatar Sebastian Andrzej Siewior Committed by Nicholas Bellinger

target/configs: remove trailing newline from udev_path and alias

This patch strips the trailing newline from backend device udev_path and
alias attributes.
Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent bc704fb5
...@@ -1708,6 +1708,9 @@ static ssize_t target_core_store_dev_alias( ...@@ -1708,6 +1708,9 @@ static ssize_t target_core_store_dev_alias(
read_bytes = snprintf(&se_dev->se_dev_alias[0], SE_DEV_ALIAS_LEN, read_bytes = snprintf(&se_dev->se_dev_alias[0], SE_DEV_ALIAS_LEN,
"%s", page); "%s", page);
if (se_dev->se_dev_alias[read_bytes - 1] == '\n')
se_dev->se_dev_alias[read_bytes - 1] = '\0';
pr_debug("Target_Core_ConfigFS: %s/%s set alias: %s\n", pr_debug("Target_Core_ConfigFS: %s/%s set alias: %s\n",
config_item_name(&hba->hba_group.cg_item), config_item_name(&hba->hba_group.cg_item),
config_item_name(&se_dev->se_dev_group.cg_item), config_item_name(&se_dev->se_dev_group.cg_item),
...@@ -1754,6 +1757,9 @@ static ssize_t target_core_store_dev_udev_path( ...@@ -1754,6 +1757,9 @@ static ssize_t target_core_store_dev_udev_path(
read_bytes = snprintf(&se_dev->se_dev_udev_path[0], SE_UDEV_PATH_LEN, read_bytes = snprintf(&se_dev->se_dev_udev_path[0], SE_UDEV_PATH_LEN,
"%s", page); "%s", page);
if (se_dev->se_dev_udev_path[read_bytes - 1] == '\n')
se_dev->se_dev_udev_path[read_bytes - 1] = '\0';
pr_debug("Target_Core_ConfigFS: %s/%s set udev_path: %s\n", pr_debug("Target_Core_ConfigFS: %s/%s set udev_path: %s\n",
config_item_name(&hba->hba_group.cg_item), config_item_name(&hba->hba_group.cg_item),
config_item_name(&se_dev->se_dev_group.cg_item), config_item_name(&se_dev->se_dev_group.cg_item),
......
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