[OpenAFS] [grand.central.org #19412] OpenAFS-1.3.85 on Solars 10 Problem with pwd after rename of a directory

Douglas E. Engert deengert@anl.gov
Wed, 03 Aug 2005 14:07:58 -0500


chas williams - CONTRACTOR wrote:

> it looks like ENODEV being returned from afs_lookup() is causing the grief.


> 
> the attached patch gets getcwd "working".  its not clear to me yet what
> is happening but it looks like when you have a bad mount, lookuppnvp()--
> used by getcwd()--gets an error from VOP_LOOKUP() and fails.

Yes that is what I am seeing EvalMountPoint is returning ENODEV.

I too have been working on a similiar patch today which appears to
fix this problem. "ls" still shows the entry, but now "ls -l" does not.
Before it showed ./badmp: nodev

Why did you change the afs_AccessOK to READ.


This really apears to be a Solaris bug, as Solaris 9 did not have a problem.



--- ,afs_vnop_lookup.c	Mon Jul 11 14:29:59 2005
+++ afs_vnop_lookup.c	Wed Aug  3 13:48:32 2005
@@ -1434,6 +1434,14 @@
  		ReleaseWriteLock(&tvc->lock);

  		if (code) {
+#if defined(AFS_SUN510_ENV)
+			/* reset code and volumeError so afs_CheckCode will not change to ENODEV */
+			/* Solaris 10 dogetcwd chokes on ENODEV, but not ENOENT */
+			if (code == ENODEV && treq.volumeError == VOLMISSING ) {
+				treq.volumeError = 0;
+				code = ENOENT;
+			}
+#endif
  		    afs_PutVCache(tvc);
  		    if (tvolp)
  			afs_PutVolume(tvolp, WRITE_LOCK);



> 
>         /*
>          * Perform a lookup in the current directory.
>          */
>         error = VOP_LOOKUP(vp, component, &tvp, pnp, lookup_flags,
>                 rootvp, cr);
>         cvp = tvp;
>         if (error) {
>                 cvp = NULL;
>                 /*
>                  * On error, return hard error if
>                  * (a) we're not at the end of the pathname yet, or
>                  * (b) the caller didn't want the parent directory, or
>                  * (c) we failed for some reason other than a missing entry.
>                  */
>                 if (pn_pathleft(pnp) || dirvpp == NULL || error != ENOENT)
>                         goto bad;
> 
> its seems that getcwd moved into the kernel in solaris10.  in earlier
> versions getcwd seemed to be in a userspace library.
> 
> Index: src/afs/VNOPS/afs_vnop_lookup.c
> ===================================================================
> RCS file: /cvs/openafs/src/afs/VNOPS/afs_vnop_lookup.c,v
> retrieving revision 1.50.2.6
> diff -u -u -r1.50.2.6 afs_vnop_lookup.c
> --- src/afs/VNOPS/afs_vnop_lookup.c	31 Jan 2005 03:49:15 -0000	1.50.2.6
> +++ src/afs/VNOPS/afs_vnop_lookup.c	3 Aug 2005 18:00:41 -0000
> @@ -1198,7 +1198,7 @@
>  
>      /* Check for read access as well.  We need read access in order to
>       * stat files, but not to stat subdirectories. */
> -    if (!afs_AccessOK(adp, PRSFS_LOOKUP, &treq, CHECK_MODE_BITS))
> +    if (!afs_AccessOK(adp, PRSFS_READ, &treq, CHECK_MODE_BITS))
>  	no_read_access = 1;
>  
>      /* special case lookup of ".".  Can we check for it sooner in this code,
> @@ -1578,5 +1578,9 @@
>      }
>  
>      afs_PutFakeStat(&fakestate);
> +if (code == ENODEV) {
> +	printf("afs_lookup() would have return ENODEV; returning ENOENT\n");
> +	code = ENOENT;
> +}
>      return code;
>  }
> 
> 
> 

-- 

  Douglas E. Engert  <DEEngert@anl.gov>
  Argonne National Laboratory
  9700 South Cass Avenue
  Argonne, Illinois  60439
  (630) 252-5444