Commit a5100d07 authored by Luo Meng's avatar Luo Meng Committed by Zheng Zengkai
Browse files

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: default avatarLuo Meng <luomeng12@huawei.com>
Reviewed-by: default avatarZhang Yi <yi.zhang@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent cdad681c
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -272,6 +272,9 @@ static struct dm_table *__hash_remove(struct hash_cell *hc)
	table = NULL;
	if (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);
	free_cell(hc);

@@ -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;
	struct mapped_device *md;
	struct hash_cell *hc;

	r = check_name(param->name);
	if (r)
@@ -796,6 +800,9 @@ static int dev_create(struct file *filp, struct dm_ioctl *param, size_t param_si

	__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);

	return 0;