提交 a5100d07 编写于 作者: L Luo Meng 提交者: Zheng Zengkai

dm ioctl: add DMINFO() to track dm device create/remove

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I61HSS
CVE: NA

--------------------------------

Add DMINFO() to help tracking device creation/removal success.
Signed-off-by: NLuo Meng <luomeng12@huawei.com>
Reviewed-by: NZhang Yi <yi.zhang@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 cdad681c
...@@ -272,6 +272,9 @@ static struct dm_table *__hash_remove(struct hash_cell *hc) ...@@ -272,6 +272,9 @@ static struct dm_table *__hash_remove(struct hash_cell *hc)
table = NULL; table = NULL;
if (hc->new_map) if (hc->new_map)
table = hc->new_map; table = hc->new_map;
DMINFO("%s[%i]: %s (%s) is removed successfully",
current->comm, current->pid, hc->md->disk->disk_name, hc->name);
dm_put(hc->md); dm_put(hc->md);
free_cell(hc); free_cell(hc);
...@@ -773,6 +776,7 @@ static int dev_create(struct file *filp, struct dm_ioctl *param, size_t param_si ...@@ -773,6 +776,7 @@ static int dev_create(struct file *filp, struct dm_ioctl *param, size_t param_si
{ {
int r, m = DM_ANY_MINOR; int r, m = DM_ANY_MINOR;
struct mapped_device *md; struct mapped_device *md;
struct hash_cell *hc;
r = check_name(param->name); r = check_name(param->name);
if (r) if (r)
...@@ -796,6 +800,9 @@ static int dev_create(struct file *filp, struct dm_ioctl *param, size_t param_si ...@@ -796,6 +800,9 @@ static int dev_create(struct file *filp, struct dm_ioctl *param, size_t param_si
__dev_status(md, param); __dev_status(md, param);
hc = dm_get_mdptr(md);
DMINFO("%s[%i]: %s (%s) is created successfully",
current->comm, current->pid, md->disk->disk_name, hc->name);
dm_put(md); dm_put(md);
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册