From patchwork Tue Nov 20 01:52:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 10689779 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 01C2F16B1 for ; Tue, 20 Nov 2018 01:52:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB14A29FB9 for ; Tue, 20 Nov 2018 01:52:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DFE1429FFD; Tue, 20 Nov 2018 01:52:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9BFBD29FB9 for ; Tue, 20 Nov 2018 01:52:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732696AbeKTMT3 (ORCPT ); Tue, 20 Nov 2018 07:19:29 -0500 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:40409 "EHLO esa5.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730379AbeKTMT3 (ORCPT ); Tue, 20 Nov 2018 07:19:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1542678772; x=1574214772; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PqsRyv7c9EpA5+rWoMDfypmdvWAN47Krw7kw/Y2Oin8=; b=ELHz3zVqv5vbsqKH49vDhVmA71FICkhPBWdjg2SAPGLDU0lAqb3jHvsf hQ99k36B9lxxMwvyJWg4/MYmEHO1RAWG30T8VwYOFghbENmMfPMQVNtaG rjhMQWeS21UPRNOtf7QrSETXOpf0l33HznbFamYzOc3COns53OiHTPAUp 0X4YepeWYbLIkRsVMMJbzlcdozkaW9HDoufNWUXgbfOD5YUrs7kFnAANL kLNmXi88cPS89Q2QLN2rSq3LQuJYFab1VDRIW2k8UYpD6TQ4IPFSEYyOU hUW/upYmAv6GYPCfzDSJ8h6SIRLf2ENrsyUcZBVcMYzYygiAPGpsW4RJN g==; X-IronPort-AV: E=Sophos;i="5.56,255,1539619200"; d="scan'208";a="95813285" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 20 Nov 2018 09:52:52 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 19 Nov 2018 17:36:07 -0800 Received: from washi.fujisawa.hgst.com ([10.149.53.254]) by uls-op-cesaip02.wdc.com with ESMTP; 19 Nov 2018 17:52:50 -0800 From: Damien Le Moal To: linux-block@vger.kernel.org, Jens Axboe Cc: Adam Manzanares , Alexander Viro , linux-fsdevel@vger.kernel.org Subject: [PATCH v2 4/6] aio: Fix fallback I/O priority value Date: Tue, 20 Nov 2018 10:52:36 +0900 Message-Id: <20181120015238.26467-5-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181120015238.26467-1-damien.lemoal@wdc.com> References: <20181120015238.26467-1-damien.lemoal@wdc.com> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- fs/aio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/aio.c b/fs/aio.c index 301e6314183b..b984918be4b7 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -1441,7 +1441,7 @@ static int aio_prep_rw(struct kiocb *req, 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))