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

Emmanuel Dreyfus manu at netbsd.org
Fri Jul 22 04:59:32 UTC 2011


Emmanuel Dreyfus <manu at netbsd.org> wrote:

> As I understand, on READDIR the glusterfs server reports the gfid of the
> shadow linkto file to the client, and subsequent file usage will report the
> correct gfid, leading to the mismatch.
> 
> You suggest that the FUSE implementation should filter out ESTALE by inssuing
> another LOOKUP? I can implement this, but I have trouble to understand why you
> have a bug report on this problem if Linux FUSE does that.

Here is a patch against 3.2.1 that fixes the problem for me. I do not master the
thing enough to evaluate potential side effects. What do you think?

--- xlators/protocol/client/srcclient3_1-fops.c.orig
+++ xlators/protocol/client/srcclient3_1-fops.c
@@ -2208,13 +2208,11 @@
         }
 
         if ((!uuid_is_null (inode->gfid))
             && (uuid_compare (stbuf.ia_gfid, inode->gfid) != 0)) {
-                gf_log (frame->this->name, GF_LOG_DEBUG,
+                gf_log (frame->this->name, GF_LOG_WARNING,
                         "gfid changed for %s", local->loc.path);
-                rsp.op_ret = -1;
-                op_errno = ESTALE;
-                goto out;
+               memcpy(&stbuf.ia_gfid, &inode->gfid, sizeof(inode->gfid));
         }
 
         rsp.op_ret = 0;
 


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




More information about the Gluster-devel mailing list