Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp4885578pjb; Mon, 27 Jul 2020 07:35:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHeTrwSRZq8k3yPquyqYTREw9wGA/vohJ3jC4wHrCr197PGPIUTZVqfvnei9ijM5XopCJS X-Received: by 2002:a50:e60b:: with SMTP id y11mr19590398edm.74.1595860526705; Mon, 27 Jul 2020 07:35:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595860526; cv=none; d=google.com; s=arc-20160816; b=AMtgtNcD1nqC/FiNP54C6Wcezwnl2W9hpvLcmDYb5pAkamIAylIavNg0aWOURyDCy0 nnetGMzT5RogNPzKvKSBwTAJ/B6iE0EtvBnxW8E3egwzpqsrZZk+XLK5huhesRzNEkYw JEuI9NszOm3yKBEQhH9TZrywL+ManGlRwyjCyK3jCCi53CqrVuw5uXb8cMMfttlXdchM +qOV39UaRJH4muP2TqmYwXK+n65Rz/hmg8JN1v+PWdkOthkdWwsoYM5Q7gbI/WBH6u7A xxE2+Jv+TZ+XlwmajqQaFqIPqO4x/CiGHx4maMW7MoPVhhZ/9nDY/72IyKRsQ4MAorQs lppw== 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=gUhSzOu9QkrAv0+1cFyucjDFrTmdTK9MQTvwNDYucks=; b=axQ8PGI40vzgBbrWKpew5iifmLh0Fiox9Oj8wXqkLRlnat3r/dtX9mpJjsr1GWqNNC dEAa+A0jNcH3JZ3IFb9R740qLm4MfGHSSSLriNiuNbNsgFXujeeWZAGnQVe69h7jGrQo zgYlBKqryTHhFZhfoFPoxDDpEQorPxUUPwBYPXFLmReHu9R27uVWgZJktzGjQ0j6ePRW VJS3JKOc2jB20OYiQp8PntHBJJm6P2TsvDFIPfJmZvwboi8SWFe9xQujWp8IZLBveO4b FcQZLfAiBHfGySTvQHpM3S6ziOmjD9u2ts12QR/c1QJhCmMIdcpJObXwfybr96zrcI/Q oQEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2HAU+HTs; 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 k16si4644878ejr.387.2020.07.27.07.35.04; Mon, 27 Jul 2020 07:35:26 -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=2HAU+HTs; 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 S1732453AbgG0OcG (ORCPT + 99 others); Mon, 27 Jul 2020 10:32:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:47688 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731427AbgG0OTk (ORCPT ); Mon, 27 Jul 2020 10:19:40 -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 2E6352070A; Mon, 27 Jul 2020 14:19:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595859579; bh=W5hJfN9Y40bj2uQePclR1+xZKsHiNxXy/7bYaeb6BKI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2HAU+HTsvNXyGqGEEuphtMWZq3u9HzyvIISdyAwH8KAnJ7WynBBTrE/JnMWqocs2d vipK8vXMBaFKeOJEb33+Ntt0Oui22Wp36f2Ww6LBwQLSOhQauFFRwTzC1GXDMTy8Zm 2YndeBgo5vbgc3ipayrx2sKW9KxlNly5EneJBXD0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Olga Kornievskaia , Anna Schumaker Subject: [PATCH 5.7 026/179] SUNRPC reverting d03727b248d0 ("NFSv4 fix CLOSE not waiting for direct IO compeletion") Date: Mon, 27 Jul 2020 16:03:21 +0200 Message-Id: <20200727134933.943922332@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200727134932.659499757@linuxfoundation.org> References: <20200727134932.659499757@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 @@ -267,6 +267,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) { @@ -278,10 +280,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) @@ -411,10 +410,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; } @@ -867,10 +864,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 @@ -83,7 +83,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; }