LINUX: dcache updates for mkdir and sillyrename 41/12141/4
authorChas Williams <3chas3@gmail.com>
Fri, 25 Dec 2015 11:37:06 +0000 (06:37 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Thu, 5 May 2016 03:20:37 +0000 (23:20 -0400)
Commit d075b0549d62e4a81b7543b9c2f5dac242074909 introduced
parent_vcache_dv() to get the data version from fakestat mount points.
.mkdir (essentially .create for directories) should use this when
updating ->d_time.

In sillyrename, __dp is a negative dentry that should be forced to
revalidate since the new name in dentry now exists.

Change-Id: I5b112ce0437bfb061479024fee745b46821e599c
Reviewed-on: https://gerrit.openafs.org/12141
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

src/afs/LINUX/osi_vnodeops.c

index 4e2159d..eb8a269 100644 (file)
@@ -1686,15 +1686,14 @@ afs_linux_sillyrename(struct inode *dir, struct dentry *dentry,
        tvc->uncred = credp;
        tvc->f.states |= CUnlinked;
        afs_linux_set_nfsfs_renamed(dentry);
+
+       __dp->d_time = 0;               /* force to revalidate */
+       d_move(dentry, __dp);
     } else {
        osi_FreeSmallSpace(__name);
     }
     AFS_GUNLOCK();
 
-    if (!code) {
-       __dp->d_time = hgetlo(VTOAFS(dir)->f.m.DataVersion);
-       d_move(dentry, __dp);
-    }
     dput(__dp);
 
     return code;
@@ -1788,7 +1787,7 @@ afs_linux_mkdir(struct inode *dip, struct dentry *dp, int mode)
 #if !defined(STRUCT_SUPER_BLOCK_HAS_S_D_OP)
        dp->d_op = &afs_dentry_operations;
 #endif
-       dp->d_time = hgetlo(VTOAFS(dip)->f.m.DataVersion);
+       dp->d_time = parent_vcache_dv(dip, credp, 1);
        d_instantiate(dp, ip);
     }
     afs_DestroyAttr(vattr);