Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1345713ybp; Thu, 17 Oct 2019 11:22:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqxei8bcxy1pERdLXCaqEJX1HAPW3j1tPT9mQZGFOQSIMpzEe8LV+fNDEpgk54v/QxsH2qJr X-Received: by 2002:a50:ee81:: with SMTP id f1mr5292143edr.243.1571336556982; Thu, 17 Oct 2019 11:22:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571336556; cv=none; d=google.com; s=arc-20160816; b=dV0QC23wEJhjGu1M0Z+FhXKkeiIJq+2lltfiOUwHv9vu9StS+lpyMBLciUgPpST6Gw rTX3NXukUSx8pCZGZBhrrMazqJDJy3r5vGeyrzmDmUZxkbCFHstz8JZY0ABftJDvhYMy yzvrTzNWS6WQ7NpCzNT7k3XwkCdW1lOrhtnbErXYQKbTy5uSsxWusovn6ZhI6oIAic9K c2WR+0t5y2If5dj10klsSRFWfp7jH9LpRJDtYfjMrnNlZIEgZSVT8gV4zRaVUcUMaQOk J0OM8h0Vhwh1Uj4pWDrgiBxnmweSkacjUeMiVZmonnemD9ON2LIZkLcwcOMI9LgxRX/G 3TLg== 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=EaTm+kMEaBuGThYkwAsCkSKPipQwzCNzLpKGQgAVmJo=; b=tKvXCJ1xH9SH+Lh4mrXz0jeBHWS1AkWiX0SA9K7Ds9aJvmKvVnS37RVI76wvquZGYu upPofc/1/eAwfzo38eyhkIry4BCTS2kuF8c9+gEDq/GS2CADHfMEilkbcxz876YlQdCQ SAHx3D8dSVwIEptIf/mebjGToTukYiD1B4ImBeT6sRweFdkRTV3ntOkah4ctZvsL/99q GekxN3yIIEx4l1uzpeQYyHZfvxfPQ7VobKKQ/7NQcRgmPG4kYUcBXdqQD+K6hUV+6qI2 j5QrnCMx/o79SD8fQDW1sXQMpuXtslFj5kcvbl6zjLPb6yL8WpmzOS9lXU2O5aarWUOq Erww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GTJVcJt+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ec21si1718650ejb.26.2019.10.17.11.22.14; Thu, 17 Oct 2019 11:22:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GTJVcJt+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2438905AbfJPWAt (ORCPT + 99 others); Wed, 16 Oct 2019 18:00:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:54756 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2438589AbfJPV7l (ORCPT ); Wed, 16 Oct 2019 17:59:41 -0400 Received: from localhost (unknown [192.55.54.58]) (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 85626222BE; Wed, 16 Oct 2019 21:59:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571263180; bh=jcdShPuHnidk5yIhTfAvb4cL0cfTH4RH8BW+cHB+4D4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GTJVcJt+YdXT9GqWvOEkxcUJLZe6DyhQYrfRJwTH3qceu+fRAiR/tYwf5E3gElHbQ DQlwz/I9nct6XdTLSN+P4lfg/EGfidwp9xiCSqE8vYPHAvYp8BaJRW4DIHJPv1/RG8 2se3pNmEWueRIa0VklFVikDF2PWU23r4Udo/8yyw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pavel Shilovsky , Steve French Subject: [PATCH 5.3 072/112] CIFS: Force revalidate inode when dentry is stale Date: Wed, 16 Oct 2019 14:51:04 -0700 Message-Id: <20191016214903.655491235@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191016214844.038848564@linuxfoundation.org> References: <20191016214844.038848564@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: Pavel Shilovsky commit c82e5ac7fe3570a269c0929bf7899f62048e7dbc upstream. Currently the client indicates that a dentry is stale when inode numbers or type types between a local inode and a remote file don't match. If this is the case attributes is not being copied from remote to local, so, it is already known that the local copy has stale metadata. That's why the inode needs to be marked for revalidation in order to tell the VFS to lookup the dentry again before openning a file. This prevents unexpected stale errors to be returned to the user space when openning a file. Cc: Signed-off-by: Pavel Shilovsky Signed-off-by: Steve French Signed-off-by: Greg Kroah-Hartman --- fs/cifs/inode.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -414,6 +414,7 @@ int cifs_get_inode_info_unix(struct inod /* if uniqueid is different, return error */ if (unlikely(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM && CIFS_I(*pinode)->uniqueid != fattr.cf_uniqueid)) { + CIFS_I(*pinode)->time = 0; /* force reval */ rc = -ESTALE; goto cgiiu_exit; } @@ -421,6 +422,7 @@ int cifs_get_inode_info_unix(struct inod /* if filetype is different, return error */ if (unlikely(((*pinode)->i_mode & S_IFMT) != (fattr.cf_mode & S_IFMT))) { + CIFS_I(*pinode)->time = 0; /* force reval */ rc = -ESTALE; goto cgiiu_exit; } @@ -924,6 +926,7 @@ cifs_get_inode_info(struct inode **inode /* if uniqueid is different, return error */ if (unlikely(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM && CIFS_I(*inode)->uniqueid != fattr.cf_uniqueid)) { + CIFS_I(*inode)->time = 0; /* force reval */ rc = -ESTALE; goto cgii_exit; } @@ -931,6 +934,7 @@ cifs_get_inode_info(struct inode **inode /* if filetype is different, return error */ if (unlikely(((*inode)->i_mode & S_IFMT) != (fattr.cf_mode & S_IFMT))) { + CIFS_I(*inode)->time = 0; /* force reval */ rc = -ESTALE; goto cgii_exit; }