From 13d6bc561e132d8d70b98a8bd3b0c42b50a0eeb4 Mon Sep 17 00:00:00 2001 From: Damien Le Moal Date: Thu, 15 Apr 2021 17:30:10 +0800 Subject: [PATCH] aio: Fix fallback I/O priority value mainline inclusion from mainline-5.0-rc1 commit 76dc891395dc61e92e2ff31b6161815ce5eb715b category: feature bugzilla: https://bugzilla.openeuler.org/show_bug.cgi?id=27 CVE: NA --------------------------- For cases when the application does not specify aio_reqprio for an aio, fallback to use get_current_ioprio() to obtain the task I/O priority last set using ioprio_set() rather than the hardcoded IOPRIO_CLASS_NONE value. Reviewed-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Reviewed-by: Adam Manzanares Signed-off-by: Damien Le Moal Signed-off-by: Jens Axboe Signed-off-by: Zhihao Cheng Signed-off-by: yangerkun Reviewed-by: zhangyi (F) Signed-off-by: Cheng Jian --- fs/aio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/aio.c b/fs/aio.c index 02954e50ef9b..a404047ab453 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -1459,7 +1459,7 @@ static int aio_prep_rw(struct kiocb *req, const struct iocb *iocb) req->ki_ioprio = iocb->aio_reqprio; } else - req->ki_ioprio = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_NONE, 0); + req->ki_ioprio = get_current_ioprio(); ret = kiocb_set_rw_flags(req, iocb->aio_rw_flags); if (unlikely(ret)) -- GitLab