Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp4889730pjb; Mon, 27 Jul 2020 07:41:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyeGevFa4kM/iQYJn9C+bT6FCZLcu1k0X7fxg8cGOamv/w8FveyLgJzlMcWRA126ZWJcYt8 X-Received: by 2002:a17:906:434c:: with SMTP id z12mr20399407ejm.33.1595860882542; Mon, 27 Jul 2020 07:41:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595860882; cv=none; d=google.com; s=arc-20160816; b=qj1EWEMPBSQSgGtyXhxFNOvDJfphMWvfEikG8OytD+rgzIEVwjHqrkkBgBr42AHiAU qaG+nGs2cTo6+3IEjPrd/cMV95V0vfSiNSwz8ZYTwSpud9zSeC18eGWEWT0WoTMYmovs f8gjT0N13ekQHb+takGtj+DYb7TuTgH3mJAd5aZixKp3h+tyOzFAjIyXDMRbZfEJ7EgV YqLIuzEXkKHwfcRkwDLfv7IMuoB0npP7mgLfZqsSanaHYF2xMW8MVHDM8arZFW6IJDYi J6J9f7It/eP/yZXERX2WTa10XR6UgSB+m25kqN1JVjZbViuJ/ror7jT39mhGu2hWiSlB 0+1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TvZmFGcXXGy4kBUqXRrJbq8/2T21Q1NbjYJ0SsLE59o=; b=GQ/NBQJod/jveto0AImIb1Jw3kRm9/9WPD8bmNCiwwZ40hK8j52dSYywwH9naDRUuW qa45KN6Bvpbg0KzL20VveI65ptc/tEEmxX/9DROimaOt97nc/eGm7Rg04jLgSQ4dRXve x6+Epb/lYTCMtQoehPORr20S+RiM8xO9cUy+qVka0+YylNt/IgvUA+1B80FrtwEWp6k3 SVMB2BxdC7UNTQO+Pgc0CTAF/VF2HP0JuFp+3KJUfHcCzTIa25zBuKbgh06qTqpdbCC7 bKaNBk2AnZIQpEHTxeWY/2EUjHA5OnQOcYKsDNOgKRZ3y6rTNd2BOtoEWbVaUIYwLZSR FXUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=e9Ah6VaG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k3si5762338ejk.32.2020.07.27.07.41.00; Mon, 27 Jul 2020 07:41:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=e9Ah6VaG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730341AbgG0Oj4 (ORCPT + 99 others); Mon, 27 Jul 2020 10:39:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:59562 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729642AbgG0OJ1 (ORCPT ); Mon, 27 Jul 2020 10:09:27 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E0C762073E; Mon, 27 Jul 2020 14:09:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595858966; bh=x1s/2p+KvPZkzbfRIAgGC9u8uVmW31LjrBx0xw9o7uI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e9Ah6VaGMms3SbGnvnaoZ8XzOkKx7OutuDx91XWuJ0Nkr8Wt2yCA54LisnSN0dzUA cnFdVS083p7GTn5OmbSVWbyfzMcmh6NRc1P2OLxuuSFq8ELYLmBlHwFLlcw8XaCC30 U5PNtrMl3afmQRWarZ+G6rEqUc3ZmM1JIJEojdc8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Olga Kornievskaia , Anna Schumaker Subject: [PATCH 4.19 15/86] SUNRPC reverting d03727b248d0 ("NFSv4 fix CLOSE not waiting for direct IO compeletion") Date: Mon, 27 Jul 2020 16:03:49 +0200 Message-Id: <20200727134915.109074546@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200727134914.312934924@linuxfoundation.org> References: <20200727134914.312934924@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Olga Kornievskaia commit 65caafd0d2145d1dd02072c4ced540624daeab40 upstream. Reverting commit d03727b248d0 "NFSv4 fix CLOSE not waiting for direct IO compeletion". This patch made it so that fput() by calling inode_dio_done() in nfs_file_release() would wait uninterruptably for any outstanding directIO to the file (but that wait on IO should be killable). The problem the patch was also trying to address was REMOVE returning ERR_ACCESS because the file is still opened, is supposed to be resolved by server returning ERR_FILE_OPEN and not ERR_ACCESS. Signed-off-by: Olga Kornievskaia Signed-off-by: Anna Schumaker Signed-off-by: Greg Kroah-Hartman --- fs/nfs/direct.c | 13 ++++--------- fs/nfs/file.c | 1 - 2 files changed, 4 insertions(+), 10 deletions(-) --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c @@ -396,6 +396,8 @@ static void nfs_direct_complete(struct n { struct inode *inode = dreq->inode; + inode_dio_end(inode); + if (dreq->iocb) { long res = (long) dreq->error; if (dreq->count != 0) { @@ -407,10 +409,7 @@ static void nfs_direct_complete(struct n complete(&dreq->completion); - igrab(inode); nfs_direct_req_release(dreq); - inode_dio_end(inode); - iput(inode); } static void nfs_direct_read_completion(struct nfs_pgio_header *hdr) @@ -540,10 +539,8 @@ static ssize_t nfs_direct_read_schedule_ * generic layer handle the completion. */ if (requested_bytes == 0) { - igrab(inode); - nfs_direct_req_release(dreq); inode_dio_end(inode); - iput(inode); + nfs_direct_req_release(dreq); return result < 0 ? result : -EIO; } @@ -960,10 +957,8 @@ static ssize_t nfs_direct_write_schedule * generic layer handle the completion. */ if (requested_bytes == 0) { - igrab(inode); - nfs_direct_req_release(dreq); inode_dio_end(inode); - iput(inode); + nfs_direct_req_release(dreq); return result < 0 ? result : -EIO; } --- a/fs/nfs/file.c +++ b/fs/nfs/file.c @@ -82,7 +82,6 @@ nfs_file_release(struct inode *inode, st dprintk("NFS: release(%pD2)\n", filp); nfs_inc_stats(inode, NFSIOS_VFSRELEASE); - inode_dio_wait(inode); nfs_file_clear_open_context(filp); return 0; }