client: Fix state of symlink with absolute path

Symlinks that have an absolute path are not getting
properly dereferenced in path_walk() due to a bug
with the cur and next inode pointers, and because
the path position wasn't getting reset on the symlink
dereference.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
test: Add symlink test for absolute paths

Signed-off-by: Sam Lang <sam.lang@inktank.com>
client: simplify path_walk() loop

Most paths were kludging around the for loop's i++.  Switch to a while
loop to avoid such tomfoolery.

Signed-off-by: Sage Weil <sage@inktank.com>
client: always follow non-trailing symlinks

If we are walking /a/b/c and a or b is a symlink, follow it.  It's only
c that we don't follow when !followsym.

Signed-off-by: Sage Weil <sage@inktank.com>
test script for s3 tests
Signed-off-by: tamil <tamil.muthamizhan@inktank.com>
test: Add tests for symlink pathological cases

The DirSyms test checks verifies that the new path_walk()
handling code properly walks through symlinked directories
even if the followsym flag is false.

The LoopSyms test checks that we correctly handle symlink
loops, where /a/b/c points back to /a.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
client:  Fix path_walk() to support dir symlinks

Additions to Sage's commits that replace the path walked so
far with the symlinked directory path, rather than the remainder
of the path to walk.  This allows the dir symlink tests to
succeed.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
client: Add symlink loop checking in path_walk()

If a loop exists in directories due to a symlink: /a/b/c -> /a
We now return -ELOOP from path_walk() instead of looping forever.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
mds: base loner decision on wanted RD|WR|EXCL, not CACHE|BUFFER

Observed instance where one client wanted the Fc cap and prevented the
loner from getting RD|WR caps.

Signed-off-by: Sage Weil <sage@inktank.com>
mds: move to from loner -> mix if *anyone* wants rd|wr

We were either going to MIX or SYNC depending on whether non-loners wanted
to read/write, but it may be that the loner wants to if our logic for
choosing loner vs not longer is based on anything other that just rd|wr
wanted.

Signed-off-by: Sage Weil <sage@inktank.com>
qa: Script to run fio and template file

Signed-off-by: Sam Lang <sam.lang@inktank.com>
java: fix return type on JNI function

Return value of declaration was is a JNI specific jlong type, while a
the return type of the definition was long. g++ not happy.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
Moving test java files into a proper heirarchy. Moving the compilation
of tests classes from build.xml to Makefile and editing configure.ac to
look for the junit4 jar in the default location of /usr/share/java. It
is still possible to build and run tests from build.xml as well as
Makefile.

Signed-off-by: Joe Buck <jbbuck@gmail.com>
Reviewed-by: Noah Watkins <noahwatkins@gmail.com>
Adding a simple workunit that executes one libcephfs-java test

Signed-off-by: Joe Buck <jbbuck@gmail.com>
Reviewed-by: Noah Watkins <noahwatkins@gmail.com>
Adding libcephfs-java.jar to .gitignore

Signed-off-by: Joe Buck <jbbuck@gmail.com>
Reviewed-by: Noah Watkins <noahwatkins@gmail.com>
Changing build.xml to produce a jar instead of class files Adding a
TestSuite class to run all tests
Remove the libcephfs-test.jar when running ant clean

Signed-off-by: Joe Buck <jbbuck@gmail.com>
Reviewed-by: Noah Watkins <noahwatkins@gmail.com>
Makefile: remove redundant EXTRA_DIST

Already set at the beginning of the Makefile.am

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
Makefile: use real file for make target

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
Makefile: only add source files to EXTRA_DIST

Prevents a make dist on a built tree from including the compiled
bytecode files produced from compiling the Java tests.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
Makefile: include Java unit test runner

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>