2018-02-11 11:38:24 +00:00
|
|
|
--- a/debugfs.c
|
|
|
|
+++ b/debugfs.c
|
2018-02-13 22:21:12 +00:00
|
|
|
@@ -87,7 +87,6 @@ static void core_dump_file(u8 *valbuf, u
|
2018-02-11 11:38:24 +00:00
|
|
|
u32 append, u32 totallen, bool textmode)
|
|
|
|
{
|
|
|
|
struct file *filp_core = NULL;
|
|
|
|
- mm_segment_t oldfs;
|
|
|
|
char file_name[40];
|
|
|
|
u8 *buf = kmalloc(length * 3, GFP_KERNEL);
|
|
|
|
u8 *data_p = buf;
|
2018-02-13 22:21:12 +00:00
|
|
|
@@ -100,9 +99,6 @@ static void core_dump_file(u8 *valbuf, u
|
2018-02-11 11:38:24 +00:00
|
|
|
sprintf(file_name, "/dev/shm/coredump-%x-%x",
|
|
|
|
region, (region + totallen));
|
|
|
|
|
|
|
|
- oldfs = get_fs();
|
|
|
|
- set_fs(KERNEL_DS);
|
|
|
|
-
|
|
|
|
if (append)
|
|
|
|
filp_core = filp_open(file_name, O_RDWR | O_APPEND, 0);
|
|
|
|
else
|
2018-02-13 22:21:12 +00:00
|
|
|
@@ -125,15 +121,15 @@ static void core_dump_file(u8 *valbuf, u
|
2018-02-11 11:38:24 +00:00
|
|
|
}
|
|
|
|
data_p = buf + j;
|
|
|
|
data_p += sprintf(data_p, "\n");
|
|
|
|
- vfs_write(filp_core, buf, strlen(buf),
|
|
|
|
- &filp_core->f_pos);
|
|
|
|
+ kernel_write(filp_core, buf, strlen(buf),
|
|
|
|
+ &filp_core->f_pos);
|
|
|
|
} else
|
|
|
|
- vfs_write(filp_core, valbuf, length, &filp_core->f_pos);
|
|
|
|
+ kernel_write(filp_core, valbuf, length,
|
|
|
|
+ &filp_core->f_pos);
|
|
|
|
|
|
|
|
filp_close(filp_core, current->files);
|
|
|
|
}
|
|
|
|
|
|
|
|
- set_fs(oldfs);
|
|
|
|
kfree(buf);
|
|
|
|
}
|
|
|
|
|