block: Fix computation of merged request priority
authorJan Kara <jack@suse.cz>
Thu, 30 Oct 2014 19:43:38 +0000 (20:43 +0100)
committerZefan Li <lizefan@huawei.com>
Mon, 2 Feb 2015 09:05:17 +0000 (17:05 +0800)
commit14194d6c2736eb1129579814dabb6e1751c7c964
tree6a47aea5edf3d44eeb2f0eb6d09de2bf9e8df6cc
parent0ec7236b1a62c0308b1249c9304f23335a72902b
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>
[lizf: Backported to 3.4: adjust filename]
Signed-off-by: Zefan Li <lizefan@huawei.com>
fs/ioprio.c