[Gluster-devel] Stale NFS file handle, then EINVAL

Emmanuel Dreyfus manu at netbsd.org
Thu Jul 21 01:27:00 UTC 2011


Emmanuel Dreyfus <manu at netbsd.org> wrote:

> Increasing the log level helps: ESTALE happens here in client3_1_lookup_cbk()
> 
>         if ((!uuid_is_null (inode->gfid))  
>             && (uuid_compare (stbuf.ia_gfid, inode->gfid) != 0)) {
>                 gf_log (frame->this->name, GF_LOG_DEBUG,
>                         "gfid changed for %s", local->loc.path);
>                 rsp.op_ret = -1;    
>                 op_errno = ESTALE;  
>                 goto out;
>         }

And indeed the link file has a different gfid, as I understand this is the
problem. But how can this happen?

server# ls -l /export/*/usr/src/gnu/dist/binutils/md5.sum
-rw-r--r--  1 root  wheel  413660 Feb  2  2006
/export/wd1a/usr/src/gnu/dist/binutils/md5.sum
---------T  1 root  wheel       0 Jul 19 09:45
/export/wd3a/usr/src/gnu/dist/binutils/md5.sum

server# getextattr -x trusted.gfid /export/*/usr/src/gnu/dist/binutils/md5.sum
/export/wd1a/usr/src/gnu/dist/binutils/md5.sum  
   000   95 77 11 b6 37 de 40 cc a9 dd c8 e1 69 7d 99 16    .w..7. at .....i}..
/export/wd3a/usr/src/gnu/dist/binutils/md5.sum  
   000   70 ce 72 2a de a5 49 98 ad c5 1f aa 83 56 05 02    p.r*..I......V..

I can reproduce that situation by a RENAME operation:

server# getextattr -x trusted.gfid  /export/*/xxxhosts
/export/wd1a/xxxhosts   
   000   52 a0 f4 f6 13 11 4e c4 94 af 36 fc b3 0a 00 f1    R.....N...6.....
/export/wd3a/xxxhosts   
   000   52 a0 f4 f6 13 11 4e c4 94 af 36 fc b3 0a 00 f1    R.....N...6.....

client# mv xxx xxxhosts

server# getextattr -x trusted.gfid  /export/*/xxxhosts 
/export/wd1a/xxxhosts   
   000   29 61 c8 54 f5 91 43 9a 8e 06 82 38 29 b7 4c ad    )a.T..C....8).L.
/export/wd3a/xxxhosts   
   000   52 a0 f4 f6 13 11 4e c4 94 af 36 fc b3 0a 00 f1    R.....N...6.....

But the file can be accessed without getting ESTALE, and gfid quickly gets
healed . Perhaps this is a race condition? 



-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu at netbsd.org




More information about the Gluster-devel mailing list