hi-

    I believe I've found a bug in path handling in OrangeFS 2.8.4.
I don't know if it impacts newer versions, but it is easy to test.
If you make a directory and then make a subdirectory with the same
name in it, then stat gets confused when it encounters filenames with
extra slashes in it.   In other words, try this:


        # cat /etc/pvfs2tab
        tcp://p9ea1:3334/pvfs2-fs /pvfsarea/pp pvfs2 defaults,noauto 0 0
        # pvfs2-mkdir /pvfsarea/pp/testdir
        # pvfs2-mkdir /pvfsarea/pp/testdir/testdir
        # pvfs2-ls    /pvfsarea/pp/testdir/some_random_string
        PVFS_sys_lookup: No such file or directory (error class: 0)
        # pvfs2-ls /pvfsarea/pp//testdir/some_random_string
        # 
        # pvfs2-ls /pvfsarea/pp/testdir/another_random_string
        PVFS_sys_lookup: No such file or directory (error class: 0)
        # pvfs2-ls /pvfsarea/pp////testdir/another_random_string
        # 

note that "pvfs2-ls" does not generate an error if I add the extra "/"
characters (and it should!).



While I am here, where is the documentation/man pages for the libpvfs2 
API?  I was looking at the pvfs2fuse as an example of using this API, 
but I'm unclear on when I need to call PVFS_Request_free() and 
PVFS_util_release_sys_attr().


For example, with PVFS_Request_free(), in pvfs2fuse.c in the function 
pvfs_fuse_read() it calls:

   PVFS_Request_contiguous(count, PVFS_BYTE, &mem_req);

That function appears to malloc() mem_req in PVFS_Request_hvector().
pvfs_fuse_read() then goes on to call "ret = PVFS_sys_read()" and based
on the return value it does:

      if (ret == 0)
   {
          PVFS_Request_free(&mem_req);
          return(resp_io.total_completed);
   }
   else 
          return PVFS_ERROR_TO_ERRNO_N( ret );

the PVFS_Request_free() function appears to free mem_req, but it is
only called if PVFS_sys_read() returns 0.   

My question: who frees mem_req if PVFS_sys_read() returns a non-zero value?


Next: PVFS_util_release_sys_attr().   pvfs2fuse.c calls PVFS_sys_getattr()
with PVFS_ATTR_SYS_ALL_NOHINT in 3 places:
   1. pvfs_fuse_getattr_pfhp()
   2. pvfs_fuse_readlink()
   3. pvfs_fuse_access()

in the first case, pvfs_fuse_getattr_pfhp(), it calls 
PVFS_util_release_sys_attr(attrs) before returning (attrs is
shorthand for &getattr_response.attr).

But in the second and third cases (readlink/access), it does not
call PVFS_util_release_sys_attr() at all, and I'm not clear on
why this is different from the pvfs_fuse_getattr_pfhp() case?


Can anyone clarify when PVFS_Request_free() and PVFS_util_release_sys_attr()
needs to be called (and maybe provide a pointer to docs so I can better
check my own code).

thanks,
chuck

_______________________________________________
Pvfs2-users mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-users

Reply via email to