You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
NFS: Fix dentry verifier races
[ Upstream commitcec08f452a] If the directory changed while we were revalidating the dentry, then don't update the dentry verifier. There is no value in setting the verifier to an older value, and we could end up overwriting a more up to date verifier from a parallel revalidation. Fixes:efeda80da3("NFSv4: Fix revalidation of dentries with delegations") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Tested-by: Benjamin Coddington <bcodding@redhat.com> Reviewed-by: Benjamin Coddington <bcodding@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
9d438dbf73
commit
8ac076ce71
@@ -1061,13 +1061,12 @@ static bool nfs_verifier_is_delegated(struct dentry *dentry)
|
||||
static void nfs_set_verifier_locked(struct dentry *dentry, unsigned long verf)
|
||||
{
|
||||
struct inode *inode = d_inode(dentry);
|
||||
struct inode *dir = d_inode(dentry->d_parent);
|
||||
|
||||
if (!nfs_verifier_is_delegated(dentry) &&
|
||||
!nfs_verify_change_attribute(d_inode(dentry->d_parent), verf))
|
||||
goto out;
|
||||
if (!nfs_verify_change_attribute(dir, verf))
|
||||
return;
|
||||
if (inode && NFS_PROTO(inode)->have_delegation(inode, FMODE_READ))
|
||||
nfs_set_verifier_delegated(&verf);
|
||||
out:
|
||||
dentry->d_time = verf;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user