From patchwork Thu Jan 16 23:16:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 233826 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52827C33CAF for ; Thu, 16 Jan 2020 23:23:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 227DF2176D for ; Thu, 16 Jan 2020 23:23:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579217009; bh=+p1YLwzGBH163D86Ax4uYWKPreijFjfAo+qlgz/VETI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=T4Nth2BPnAEr+yPW+GpYUVF5Nify3DHg6x6UIr9hMFNtuN7eBx/xQuHEUVfEUjIo5 jeGxHA+Pk42RfPQbvz6C94btPmFko8ZiK3Pucx5CLhZAHNLfsmK0YUo+PtWaieP/Oo JGXV5NkRYK1QES/vkj4PYKvUxqLelfZ9Rbdgm3kc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730778AbgAPXX2 (ORCPT ); Thu, 16 Jan 2020 18:23:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:51750 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733076AbgAPXX0 (ORCPT ); Thu, 16 Jan 2020 18:23:26 -0500 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 3BFBD2077C; Thu, 16 Jan 2020 23:23:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579217005; bh=+p1YLwzGBH163D86Ax4uYWKPreijFjfAo+qlgz/VETI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dcanvigVRdQZitTfdXSG4zBpZQs+/lv1SjwpecTPPlo3xu3yUfseppsKuGCenIaOS yNszDSYV/F4QloXf2ZBVWlccQdJV7CfYw6CsL0LptD7PX50pQyNBcpdtWucI4yTxqY iz5Lpu5UjCTqM9/KoSo28aMZNIRBVttDO+yRCHX8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Howells , Linus Torvalds Subject: [PATCH 5.4 083/203] afs: Fix afs_lookup() to not clobber the version on a new dentry Date: Fri, 17 Jan 2020 00:16:40 +0100 Message-Id: <20200116231752.393959400@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200116231745.218684830@linuxfoundation.org> References: <20200116231745.218684830@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: David Howells commit f52b83b0b1c40ada38df917973ab719a4a753951 upstream. Fix afs_lookup() to not clobber the version set on a new dentry by afs_do_lookup() - especially as it's using the wrong version of the version (we need to use the one given to us by whatever op the dir contents correspond to rather than what's in the afs_vnode). Fixes: 9dd0b82ef530 ("afs: Fix missing dentry data version updating") Signed-off-by: David Howells Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- fs/afs/dir.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) --- a/fs/afs/dir.c +++ b/fs/afs/dir.c @@ -952,12 +952,8 @@ static struct dentry *afs_lookup(struct afs_stat_v(dvnode, n_lookup); inode = afs_do_lookup(dir, dentry, key); key_put(key); - if (inode == ERR_PTR(-ENOENT)) { + if (inode == ERR_PTR(-ENOENT)) inode = afs_try_auto_mntpt(dentry, dir); - } else { - dentry->d_fsdata = - (void *)(unsigned long)dvnode->status.data_version; - } if (!IS_ERR_OR_NULL(inode)) fid = AFS_FS_I(inode)->fid;