<br><br><div class="gmail_quote">On Mon, Sep 10, 2012 at 12:11 PM, Gustavo Bervian Brand <span dir="ltr">&lt;<a href="mailto:gugabrand@gmail.com" target="_blank">gugabrand@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>Hello,</div><div><br></div><div>   I wasn&#39;t using the synctask_new worker, but now I implemented my code using it to trigger the create/write call. Btw, is the usage of syncop calls documented somewhere? I found it through the history of the dev-list.<div>


<br></div><div>  But going ahead on my issue, I was able to create the file avoiding the NFS stale handle error. The file is being created at the backend, but the syncop_create call it&#39;s still returning an error from the posix translator at the server side. I copied the error from the glusterd log below... I am checking the code trying to figure it out.</div>


<div><br></div><div>  To write the file I am generating a new gfid for the local file and setting the pargfid as 1 (root node) with the loc.parent pointing to the inode-&gt;table-&gt;root inode. Below I copied what is being copied the loc, fd, flag and mode_t structures being used at the create call. </div>


<div><br></div><div>*** From the glusterd log:</div><div><div>[2012-09-10 18:12:34.035940] W [posix-handle.c:590:posix_handle_hard] 0-examplevol1: mismatching ino/dev between file /bricks/exampleDir_local/1ccfca9f (146628/2049) and handle /bricks/exampleDir_local/.glusterfs/00/00/00000000-0000-0000-0000-000000000000 (146617/2049)</div>


<div>[2012-09-10 18:12:34.035977] E [posix.c:1724:posix_create] 0-examplevol1: setting gfid on /bricks/exampleDir_local/1ccfca9f failed</div></div><div><br></div>*** Relevant code before calling the create function</div>

<div>
<div> 107                 inode_t *newinode = inode_new (old_loc.inode-&gt;table);</div><div> 108 </div><div> 109                 loc.path = strdup(hashed_path_str);</div><div> 110                 <a href="http://loc.name" target="_blank">loc.name</a> = strdup(hashed_filename_str);</div>


<div> 111                 loc.inode = newinode;</div><div> 113                 loc.parent = loc.inode-&gt;table-&gt;root;</div><div> 115                 uuid_copy(loc.gfid, gfid);</div><div> 116 </div><div> 118                 memset (loc.pargfid, 0, 16);</div>


<div> 119                 loc.pargfid[15] = 1;</div><div> 120 </div><div> 121                 fd = fd_create (loc.inode, getpid());</div><div>...</div><div> 127 </div><div> 128                 uint32_t flags = O_CREAT | O_RDWR | O_EXCL;</div>


<div> 129                 mode_t mode = (mode_t)0700;</div><div> 130                 fd-&gt;flags = flags;</div><div> 131                 fd = fd_ref(fd);</div><div><br></div></div></blockquote><div><br></div><div>It is very likely you are just missing setting the &quot;gfid-req&quot; field in the dictionary. You can check how fuse-bridge, nfs, api/src/glfs.c are all setting gfid-req. In your case you would want to copy the GFID of the original file for the cached file as well.</div>
<div><br></div><div>Avati</div><div><br></div></div>