linux-dentry-revalidate-make-sysname-lists-work-20030924
[openafs.git] / src / afs / LINUX / osi_vnodeops.c
index d6bbf18..0e0ec36 100644 (file)
@@ -350,7 +350,17 @@ afs_linux_readdir(struct file *fp, void *dirbuf, filldir_t filldir)
 
        ino = (avc->fid.Fid.Volume << 16) + ntohl(de->fid.vnode);
        ino &= 0x7fffffff;      /* Assumes 32 bit ino_t ..... */
-       len = strlen(de->name);
+       if (de->name)
+           len = strlen(de->name);
+       else {
+           printf("afs_linux_readdir: afs_dir_GetBlob failed, null name (inode %x, dirpos %d)\n", 
+                  &tdc->f.inode, dirpos);
+           DRelease(de, 0);
+           afs_PutDCache(tdc);
+           ReleaseReadLock(&avc->lock);
+           afs_PutFakeStat(&fakestat);
+           return -ENOENT;
+       }
 
        /* filldir returns -EINVAL when the buffer is full. */
 #if (defined(AFS_LINUX24_ENV) || defined(pgoff2loff)) && defined(DECLARE_FSTYPE)
@@ -916,8 +926,11 @@ afs_linux_dentry_revalidate(struct dentry *dp)
        goto done;
     }
 
-    /* A DNLC lookup failure cannot be trusted. Try a real lookup */
-    code = afs_lookup(parentvcp, name, &lookupvcp, credp);
+    /* A DNLC lookup failure cannot be trusted. Try a real lookup. 
+       Make sure to try the real name and not the @sys expansion; 
+       afs_lookup will expand @sys itself. */
+  
+    code = afs_lookup(parentvcp, dp->d_name.name, &lookupvcp, credp);
 
     /* Verify that the dentry does not point to an old inode */
     if (vcp != lookupvcp)