Adds --enable-cephfs-java and --with-jdk to build
the libcephfs Java bindings and specify the default
JDK directory, respectively.
Also adds default JDK paths to avoid --with-jdk in
the common case. Currently setup for the default
provided by Debian's default-jdk package, but other
default search paths can easily be added.
Sam Lang [Thu, 18 Oct 2012 15:02:17 +0000 (10:02 -0500)]
client: Fix permissions error on open with O_CREAT
Posix allows creating/opening a file with
open() with a mode that doesn't allow write (or read)
access but flags that request it: O_CREAT|O_WRONLY.
This means that correct permissions checking against
the mode on open() only happens if the file already exists.
Sage Weil [Thu, 18 Oct 2012 00:44:12 +0000 (17:44 -0700)]
addr_parsing: make , and ; and ' ' all delimiters
Instead of just ,. Currently "foo.com, bar.com" will fail because of the
space after the comma. This patches fixes that, and makes all delim
chars interchangeable.
mon: MonitorStore: fix error checks for mkdir operations
We introduced a bug on the monitor store a couple of commits back that
would trigger a EEXIST error message when the store tried to make sure
a directory exists by trying to 'mkdir' it.
We now check if 'errno' is EEXIST and, if so, we ignore the error.
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Sage Weil [Wed, 17 Oct 2012 18:59:36 +0000 (11:59 -0700)]
client: initialize tid in MetaRequest ctor
CID 717207 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
At (2): Non-static class member "tid" is not initialized in this constructor nor in any functions that it calls.
Sam Lang [Thu, 11 Oct 2012 17:16:02 +0000 (12:16 -0500)]
client: Fix stat of relative symlinks
Stat of symlinks that are relative to their location
would return -ENOENT because the symlink target is
being appended to the path rather than replacing it.
This fix replaces the symlink component with the path
of the symlink target (in the case that its a relative
symlink), and avoids updating the inode to point the
symlink (keeps at the parent).
Sam Lang [Wed, 10 Oct 2012 15:16:53 +0000 (10:16 -0500)]
client: Implement stat and correct lstat
lstat is meant to not follow symbolic links in
the given path, whereas stat does. This adds a
stat function to Client and libcephfs and changes
the behavior of lstat to not follow symlinks.
mon: MonitorStore: check mkdir return value for errors
CID 728081: Unchecked return value (CHECKED_RETURN)
At (5): Calling function "mkdir(dfn, 493U)" without checking return value.
CID 716853: Unchecked return value (CHECKED_RETURN)
At (2): Calling function "mkdir(fn, 493U)" without checking return value.
CID 716855: Unchecked return value (CHECKED_RETURN)
At (2): Calling function "mkdir(fn, 493U)" without checking return value.
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
mon: MonitorStore: check return value for errors on 'open'
CID 728083: Argument cannot be negative (NEGATIVE_RETURNS)
At (22): "dirfd" is passed to a parameter that cannot be negative.
At (29): "dirfd" is passed to a parameter that cannot be negative.
CID 717445: Argument cannot be negative (NEGATIVE_RETURNS)
At (3): "dirfd" is passed to a parameter that cannot be negative.
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
CID 716850: Unchecked return value (CHECKED_RETURN)
At (14): Calling function "KeyServer::get_auth(EntityName const &,
EntityAuth &) const" without checking return value.
CID 716849: Unchecked return value (CHECKED_RETURN)
At (14): Calling function "EntityName::from_str(std::string const &)"
without checking return value.
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
CID 717443: Dereference after null check (FORWARD_NULL)
At (14): Passing null pointer "detailbl" to function
"ceph::buffer::list::append(std::string const &)", which dereferences it.
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Sam Lang [Tue, 16 Oct 2012 16:45:26 +0000 (11:45 -0500)]
client: Add permissions checking to open
Users of the libcephfs api (fuse in particular)
don't check the mode against the open flags. This
commit does the proper checks to grant/deny access
to the file. The check_mode() function constructs
a requested mode based on the flags, and compares that
to the mode of the file.
Sage Weil [Tue, 16 Oct 2012 20:03:53 +0000 (13:03 -0700)]
mds: explicitly queue messages for unconnected clients
Previously, the messenger would queue messages for a destination that
didn't exist when you were a server; that changed a while back with the
wip-msgr merge (circa v0.52). The result is that when we force open
client sessions and queue messages, they are dropped on the floor and the
client--when it does connect--gets confusing stuff from the MDS.
Instead, explicitly queue and send these messages. Also, *always* send
via the Connection* instead of the inst.
Fixes: #2681 Signed-off-by: Sage Weil <sage@inktank.com>
Sage Weil [Tue, 16 Oct 2012 18:47:29 +0000 (11:47 -0700)]
client: fix implemented caps update on release/flush
When we release caps, clear them out of implemented as well, unless we
still hold references. Otherwise implemented ends up holding all sorts of
extra caps (e.g., when nothing is getting revoked), leading to confusion
later down the line.
This now mirrors the kernel code.
Fixes: #3301 Signed-off-by: Sage Weil <sage@inktank.com>
Sage Weil [Mon, 8 Oct 2012 23:04:21 +0000 (16:04 -0700)]
librbd: use map-based stripe method to avoid fragmenting io
If we have multiple extents to read from the parent, accumulate the
resulting IO requests on a single map of ObjectExtents so that we can
merge adjacent IOs. This helps with the copy-up when the parent and child
striping match, for example.
Sage Weil [Mon, 8 Oct 2012 23:02:12 +0000 (16:02 -0700)]
striper: expose method that works directrly from a map<>
Some callers will want to call the stripe method multiple times and
accumulate IO on a single result set. Expose access to the map<> that was
previously internally used for this and do the map -> vector conversion
in a wrapper.
Sage Weil [Thu, 4 Oct 2012 00:15:10 +0000 (17:15 -0700)]
librbd: make read_iterate iterate over periods
Object sizes no longer make sense since we are iterating over the logical
device image space, and the striping may make that unrelated to the size
of the individual objects.
Sage Weil [Thu, 4 Oct 2012 23:53:27 +0000 (16:53 -0700)]
librbd: reimplement striping
This replaces most of the existing striping code with use of the Filer
striping helper methods and a more general ceph_file_layout that can
handle more sophisticated striping patterns that the previous uniform
object approach.
This patch is not fully complete; there are a few additional patches that
follow that clean up some of the support functions. However, most of the
IO path is covered here.