Commit 31c89007 authored by Audra Mitchell's avatar Audra Mitchell Committed by Tejun Heo

workqueue.c: Increase workqueue name length

Currently we limit the size of the workqueue name to 24 characters due to
commit ecf6881f ("workqueue: make workqueue->name[] fixed len")
Increase the size to 32 characters and print a warning in the event
the requested name is larger than the limit of 32 characters.
Signed-off-by: default avatarAudra Mitchell <audra@redhat.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 052d5343
...@@ -108,7 +108,7 @@ enum { ...@@ -108,7 +108,7 @@ enum {
RESCUER_NICE_LEVEL = MIN_NICE, RESCUER_NICE_LEVEL = MIN_NICE,
HIGHPRI_NICE_LEVEL = MIN_NICE, HIGHPRI_NICE_LEVEL = MIN_NICE,
WQ_NAME_LEN = 24, WQ_NAME_LEN = 32,
}; };
/* /*
...@@ -4666,6 +4666,7 @@ struct workqueue_struct *alloc_workqueue(const char *fmt, ...@@ -4666,6 +4666,7 @@ struct workqueue_struct *alloc_workqueue(const char *fmt,
va_list args; va_list args;
struct workqueue_struct *wq; struct workqueue_struct *wq;
struct pool_workqueue *pwq; struct pool_workqueue *pwq;
int len;
/* /*
* Unbound && max_active == 1 used to imply ordered, which is no longer * Unbound && max_active == 1 used to imply ordered, which is no longer
...@@ -4692,9 +4693,12 @@ struct workqueue_struct *alloc_workqueue(const char *fmt, ...@@ -4692,9 +4693,12 @@ struct workqueue_struct *alloc_workqueue(const char *fmt,
} }
va_start(args, max_active); va_start(args, max_active);
vsnprintf(wq->name, sizeof(wq->name), fmt, args); len = vsnprintf(wq->name, sizeof(wq->name), fmt, args);
va_end(args); va_end(args);
if (len >= WQ_NAME_LEN)
pr_warn_once("workqueue: name exceeds WQ_NAME_LEN. Truncating to: %s\n", wq->name);
max_active = max_active ?: WQ_DFL_ACTIVE; max_active = max_active ?: WQ_DFL_ACTIVE;
max_active = wq_clamp_max_active(max_active, flags, wq->name); max_active = wq_clamp_max_active(max_active, flags, wq->name);
......
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