[vox-tech] stale NFS file (was: binary equivalence of two directories)

Peter Jay Salzman p at dirac.org
Thu Mar 17 09:34:26 PST 2005


On Thu 17 Mar 05,  8:54 AM, Josh Parsons <jbparsons at ucdavis.edu> said:
> > Any file that diff reported "Stale NFS file handle", I can cat, edit,
> > play,...
> > I don't even know how to diagnose the cause.
> 
> I've no idea either what's wrong, but if I were you, I'd start by seeing
> what syscall diff is using (and cat etc. aren't) that provokes the
> error.  Try running your diff invocation under strace.
 
Great idea.  I should've thought of that!  It revealed something I've never
seen before.  There are initially no files named ".l*" in the directory:

   p at satan$ cd /E/documentation/Videos/Lynda.com/
   p at satan$ ls -la .l*
   ls: .l*: No such file or directory
   p at satan$ vi log

At this point, vim complains that it found a swap file .log.swp and asks me
if I want to "Open Read-Only", "Abort", etc.  When I "Quit", the log file is
there:

   p at satan$ ls .l*
   .log.swo  .log.swp

It looks like vim creates the swap files and THEN checks to see if a swap
file exists.  Holy cow!

I had to write the log file elsewhere from /E.  Writing the log file in
$HOME seemed to work.   Here's a line from stracing diff -r:

  stat64("/E/documentation/Videos/Lynda.com/project2/Getting Started with
    Corel  Painter 8/autorun.inf", 0xbffff108) = -1 ESTALE (Stale NFS file
    handle)

So then I tried to ls the file.  For ls, stat() seemed to work:

   stat64("/E/documentation/Videos/Lynda.com/project2/Getting Started with
   Corel Painter 8/autorun.inf", {st_mode=S_IFREG|0775, st_size=46, ...}) = 0


And when I just diff *that* single file, it seems to work:

p at satan$ diff /E/documentation/Videos/Lynda.com/project2/Getting\ Started\
with\ Corel\ Painter\ 8/autorun.inf  /dvd/Getting\ Started\ with\ Corel\ \
Painter\ 8/autorun.inf 
p at satan


So there appears to be two manifestations of the problem:

1. Vim creates the swap file before checking the swap file's existence on
these NFS mounted partitions.

2. As far as diff -r goes, the stale NFS message appeas only when I start
diffing a lot of large files.  It appears to work fine for single files.
The culprit appears to be stat64().

I'm feeling like I shouldn't have gotten out of bed today.  :-(

Pete

-- 
Save Star Trek Enterprise from extinction: http://www.saveenterprise.com

GPG Fingerprint: B9F1 6CF3 47C4 7CD8 D33E  70A9 A3B9 1945 67EA 951D


More information about the vox-tech mailing list