From patchwork Sat Nov 17 23:53:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 10687649 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 6BBAB69B7 for ; Sat, 17 Nov 2018 23:53:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5A6002A12E for ; Sat, 17 Nov 2018 23:53:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4E9AF2A127; Sat, 17 Nov 2018 23:53:29 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham 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 E181F2A134 for ; Sat, 17 Nov 2018 23:53:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727002AbeKRKLw (ORCPT ); Sun, 18 Nov 2018 05:11:52 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:40256 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726922AbeKRKLw (ORCPT ); Sun, 18 Nov 2018 05:11:52 -0500 Received: by mail-pf1-f195.google.com with SMTP id x2-v6so13090444pfm.7 for ; Sat, 17 Nov 2018 15:53:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DX9PRhymEZ4mlMuP0D8G+UTxW3e/vnqplxNza5QmpL0=; b=MHQx5tgNVr/0IzWBFYVFXTD/Q82ukLzGozE8MZvzFd0CIPL9/GSkReYq7ReXoqux7s Cbr2xVcE5Lzb0L7LEqndZhia8/+fgZ6dEFFN/b7EhxVeiCluf9vMLtB9EEFc034/ch3+ rHm1Rf5YwB4LXU9TM8nfO40UNKt3ZloXRib/ZvQOKAh9jFetwf+MUx6ogfSRpC8qalE0 Uc4n3F0YZbijX2DszRN5Z7x5uc1CaWRxVKWi7a1hL8UbCxfK/ZrVdL+yBg/5D3xEt7o5 cLNMionl9wOo3nVdbBupaIB1rii/oWw8I1xjsfkMix83te0Fo30T92I+/jV42t4WDo5i CGBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=DX9PRhymEZ4mlMuP0D8G+UTxW3e/vnqplxNza5QmpL0=; b=oK+8zHrPNmvlDJQufhjZ5zuPGrC71z04DJVLPj+EAF28Ub4C7oNUMY4FEyhG7qF45C FHZPjXTubWLcAuowq2L3QYgPuc+MWYEV6cEv+Y3vi/NuqCqIs2pk4OHJYi1g8G3IXwaL hXRdiRvbSoZDnBiIy4Q6wKK2qm5RacrAhj50AyOR5zjJMWUZom+pLEy1ymnvds3l1OpU T+iIL1Jo9dBkO5wrICANIP6gqk91BV+5XU2T7UxMMoK5vAsSQt8Qw6EwfxuRAajj4vR5 OJqMaLA4sT3glfupK7F8+DUoHDd8srZwkf8qjOYDG3K4xq9MzPw5XcLO6ucLk/RkrrTG Ybng== X-Gm-Message-State: AA+aEWaWiZUGVXqnVSe8QcewOU1zAJyyiAJ+2NMQOAT0aiBNQq6iMa7l EZSAij/5O/6k/6a2iPBiMLdQqg== X-Google-Smtp-Source: AJdET5fGzhKB5IK77SMtjoR5qGZO2O0k3GHxUtlUXPL/J33omH8Tp6B4Ghr7+MEMf+DRVlgdB72hNQ== X-Received: by 2002:a62:868b:: with SMTP id x133mr2492710pfd.252.1542498807089; Sat, 17 Nov 2018 15:53:27 -0800 (PST) Received: from x1.localdomain (66.29.188.166.static.utbb.net. [66.29.188.166]) by smtp.gmail.com with ESMTPSA id m1sm15812345pgn.9.2018.11.17.15.53.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 17 Nov 2018 15:53:26 -0800 (PST) From: Jens Axboe To: linux-block@vger.kernel.org, linux-aio@kvack.org, linux-fsdevel@vger.kernel.org Cc: Jens Axboe Subject: [PATCH 2/5] aio: fix failure to put the file pointer Date: Sat, 17 Nov 2018 16:53:14 -0700 Message-Id: <20181117235317.7366-3-axboe@kernel.dk> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181117235317.7366-1-axboe@kernel.dk> References: <20181117235317.7366-1-axboe@kernel.dk> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If the ioprio capability check fails, we return without putting the file pointer. Fixes: d9a08a9e616b ("fs: Add aio iopriority support") Signed-off-by: Jens Axboe Reviewed-by: Christoph Hellwig --- fs/aio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/aio.c b/fs/aio.c index b36691268b6c..3d9bc81cf500 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -1436,6 +1436,7 @@ static int aio_prep_rw(struct kiocb *req, struct iocb *iocb) ret = ioprio_check_cap(iocb->aio_reqprio); if (ret) { pr_debug("aio ioprio check cap error: %d\n", ret); + fput(req->ki_filp); return ret; }