Return-Path: Received: from mail-by2nam03on0101.outbound.protection.outlook.com ([104.47.42.101]:39731 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932603AbeARVEi (ORCPT ); Thu, 18 Jan 2018 16:04:38 -0500 From: Sasha Levin To: "stable@vger.kernel.org" , "stable-commits@vger.kernel.org" CC: Trond Myklebust , Anna Schumaker , Sasha Levin Subject: [added to the 4.1 stable tree] NFS: Fix a typo in nfs_rename() Date: Thu, 18 Jan 2018 21:01:07 +0000 Message-ID: <20180118205908.3220-194-alexander.levin@microsoft.com> References: <20180118205908.3220-1-alexander.levin@microsoft.com> In-Reply-To: <20180118205908.3220-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Trond Myklebust This patch has been added to the stable tree. If you have any objections, please let us know. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D [ Upstream commit d803224c84be067754db7fa58a93f36f61566493 ] On successful rename, the "old_dentry" is retained and is attached to the "new_dir", so we need to call nfs_set_verifier() accordingly. Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker Signed-off-by: Sasha Levin --- fs/nfs/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 1484ae1907c6..d2cb63259560 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -2076,7 +2076,7 @@ int nfs_rename(struct inode *old_dir, struct dentry *= old_dentry, if (new_inode !=3D NULL) nfs_drop_nlink(new_inode); d_move(old_dentry, new_dentry); - nfs_set_verifier(new_dentry, + nfs_set_verifier(old_dentry, nfs_save_change_attribute(new_dir)); } else if (error =3D=3D -ENOENT) nfs_dentry_handle_enoent(old_dentry); --=20 2.11.0