summaryrefslogtreecommitdiffstats
path: root/include/linux/ioprio.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/ioprio.h')
-rw-r--r--include/linux/ioprio.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/linux/ioprio.h b/include/linux/ioprio.h
index 8e2042b9d471..2eaa142cd061 100644
--- a/include/linux/ioprio.h
+++ b/include/linux/ioprio.h
@@ -47,8 +47,10 @@ enum {
#define IOPRIO_NORM (4)
static inline int task_ioprio(struct task_struct *task)
{
- WARN_ON(!ioprio_valid(task->ioprio));
- return IOPRIO_PRIO_DATA(task->ioprio);
+ if (ioprio_valid(task->ioprio))
+ return IOPRIO_PRIO_DATA(task->ioprio);
+
+ return IOPRIO_NORM;
}
static inline int task_nice_ioprio(struct task_struct *task)
OpenPOWER on IntegriCloud