aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--block/blktrace.c3
-rw-r--r--include/linux/blktrace_api.h8
2 files changed, 5 insertions, 6 deletions
diff --git a/block/blktrace.c b/block/blktrace.c
index 9e0212c90b29..85049a7e7a17 100644
--- a/block/blktrace.c
+++ b/block/blktrace.c
@@ -369,7 +369,8 @@ int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
369 if (!buts->buf_size || !buts->buf_nr) 369 if (!buts->buf_size || !buts->buf_nr)
370 return -EINVAL; 370 return -EINVAL;
371 371
372 strcpy(buts->name, name); 372 strncpy(buts->name, name, BLKTRACE_BDEV_SIZE);
373 buts->name[BLKTRACE_BDEV_SIZE - 1] = '\0';
373 374
374 /* 375 /*
375 * some device names have larger paths - convert the slashes 376 * some device names have larger paths - convert the slashes
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h
index a2a7d0ca2758..3a31eb506164 100644
--- a/include/linux/blktrace_api.h
+++ b/include/linux/blktrace_api.h
@@ -122,15 +122,13 @@ enum {
122 Blktrace_stopped, 122 Blktrace_stopped,
123}; 123};
124 124
125#define BLKTRACE_BDEV_SIZE 32
126
125/* 127/*
126 * User setup structure passed with BLKTRACESTART 128 * User setup structure passed with BLKTRACESTART
127 */ 129 */
128struct blk_user_trace_setup { 130struct blk_user_trace_setup {
129#ifdef __KERNEL__ 131 char name[BLKTRACE_BDEV_SIZE]; /* output */
130 char name[BDEVNAME_SIZE]; /* output */
131#else
132 char name[32]; /* output */
133#endif
134 __u16 act_mask; /* input */ 132 __u16 act_mask; /* input */
135 __u32 buf_size; /* input */ 133 __u32 buf_size; /* input */
136 __u32 buf_nr; /* input */ 134 __u32 buf_nr; /* input */