From patchwork Sat Dec 17 18:27:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 9479091 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 59D1460830 for ; Sat, 17 Dec 2016 18:27:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4FD60285AC for ; Sat, 17 Dec 2016 18:27:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 44A40285B9; Sat, 17 Dec 2016 18:27:21 +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=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 E3E28285AC for ; Sat, 17 Dec 2016 18:27:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756096AbcLQS1T (ORCPT ); Sat, 17 Dec 2016 13:27:19 -0500 Received: from mail-io0-f196.google.com ([209.85.223.196]:34050 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752554AbcLQS1S (ORCPT ); Sat, 17 Dec 2016 13:27:18 -0500 Received: by mail-io0-f196.google.com with SMTP id y124so15270761iof.1 for ; Sat, 17 Dec 2016 10:27:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=cF9ELqM0adeue0eKF3Up3m3iyb6eJ5fBCklieILWAZc=; b=aYW2xW3a0rQDU5qTPsWqOL/C/M3TJCSiIGIhqjwvWVTGqHIAb20cCETjDQpFlxakkm Ff2L6TIwNtxc7pZwqQCwVBw+sKBA9Ds7tirNQr/neRLODqG5I8xGG851La2kGOMGP+q0 MiCa3WGhnmFJTHwcOJ/HmCptMmJEPiGFGuweUiq7OVLBMgaX6U4lcnvvwyu0lMCPxfIu jEEyyEAIU5Y11Ker0pP483jBYTd/7Zrlap34SUjHtnbT97OaVZe2iYQP4Y1ZVYapJVQs n7pEMXKb4gWLrPMSUZWA/wRS2OmUDbWkLvHwQM5JSkDiAcXjV/zrFikZxIsdefnQluBo iNAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=cF9ELqM0adeue0eKF3Up3m3iyb6eJ5fBCklieILWAZc=; b=PE0XbrG6CeQk4LW4yeaEDks+j46f8ntMlQHn/l5lgg0avruUI9mIu3Ul7QCt/0Jl5Z lhBAuFUwDBwugur2jrX8msu9HEieAbro9FvO65RmrsK4P44lqOD5YtjNpK92aNHUw8/g csAEFERX5BW+NPyXyBf0C8c3fHFaZ2T/XopRMm12F/SBN0/OXtrKXEY7IavDHbbxz1wJ zfF8nyxbEsnkcQYK15abIMrT/XxF1wuAbfpJ99jSZrvW13IATVjlrS3NtIojpZZm0NJH /anN5KYy05lb3dT5XSONvebbje8zFygooiUm1S0gKJNHYR9BPCXYOObSxu0gS7ysrSx7 2DOA== X-Gm-Message-State: AIkVDXI0dXWbR4Pxo3MZCs+uftCnBMOTR3+9nEIL+tLCp4mi/zuEmXTdZmUAvcLCnDB1BQ== X-Received: by 10.107.18.39 with SMTP id a39mr8187797ioj.45.1481999237747; Sat, 17 Dec 2016 10:27:17 -0800 (PST) Received: from localhost.localdomain (c-68-49-162-121.hsd1.mi.comcast.net. [68.49.162.121]) by smtp.gmail.com with ESMTPSA id y125sm3587595ity.13.2016.12.17.10.27.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 17 Dec 2016 10:27:16 -0800 (PST) From: Trond Myklebust To: linux-nfs@vger.kernel.org Subject: [PATCH 3/9] NFSv4: Don't discard the attributes returned by asynchronous DELEGRETURN Date: Sat, 17 Dec 2016 13:27:05 -0500 Message-Id: <20161217182711.10643-4-trond.myklebust@primarydata.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20161217182711.10643-3-trond.myklebust@primarydata.com> References: <20161217182711.10643-1-trond.myklebust@primarydata.com> <20161217182711.10643-2-trond.myklebust@primarydata.com> <20161217182711.10643-3-trond.myklebust@primarydata.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP DELEGRETURN will always carry a reference to the inode except when the latter is being freed, so let's ensure that we always use that inode information to ensure close-to-open cache consistency, even when the DELEGRETURN call is asynchronous. Signed-off-by: Trond Myklebust --- fs/nfs/nfs4proc.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 2e0816cb7136..58e3d5f627f2 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -5702,6 +5702,7 @@ static void nfs4_delegreturn_release(void *calldata) if (data->lr.roc) pnfs_roc_release(&data->lr.arg, &data->lr.res, data->res.lr_ret); + nfs_post_op_update_inode_force_wcc(inode, &data->fattr); nfs_iput_and_deactive(inode); } kfree(calldata); @@ -5790,10 +5791,6 @@ static int _nfs4_proc_delegreturn(struct inode *inode, struct rpc_cred *cred, co if (status != 0) goto out; status = data->rpc_status; - if (status == 0) - nfs_post_op_update_inode_force_wcc(inode, &data->fattr); - else - nfs_refresh_inode(inode, &data->fattr); out: rpc_put_task(task); return status;