block: Fix computation of merged request priority
commit0d3390c09d73214cf9f44d5b791b10c2b682c7da
authorJan Kara <jack@suse.cz>
Thu, 30 Oct 2014 19:43:38 +0000 (30 20:43 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Nov 2014 17:23:12 +0000 (21 09:23 -0800)
treef9f47bf7886a3faa62e0b9173f9b77eec09701a4
parent10c6d3ff1ea5122888e11d76cf3e8c8fb2dac973
block: Fix computation of merged request priority

commit ece9c72accdc45c3a9484dacb1125ce572647288 upstream.

Priority of a merged request is computed by ioprio_best(). If one of the
requests has undefined priority (IOPRIO_CLASS_NONE) and another request
has priority from IOPRIO_CLASS_BE, the function will return the
undefined priority which is wrong. Fix the function to properly return
priority of a request with the defined priority.

Fixes: d58cdfb89ce0c6bd5f81ae931a984ef298dbda20
Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
block/ioprio.c