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.
Signed-off-by: Sam Lang <sam.lang@inktank.com>
CID 716854: Unchecked return value (CHECKED_RETURN)
At (10): Calling function "rename(tfn, fn)" without checking return value.
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
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>
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 716851: Unchecked return value (CHECKED_RETURN)
At (51): Calling function "ceph::buffer::list::write_fd(int) const"
without checking return value.
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
CID 716947 (#1 of 2): Missing unlock (LOCK)
CID 716947 (#2 of 2): Missing unlock (LOCK)
At (25): Returning without unlocking "this->lock._m".
There were a couple of cases in Monitor::init() that could lead us to
return without properly unlocking. Coverity gets mad props for uncovering
this.
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>
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.
Signed-off-by: Sam Lang <sam.lang@inktank.com>
- don't delete the pool during the run
- ignore create error codes (may succeed for return EEXIST)
- use a unique pool name
Signed-off-by: Sage Weil <sage@inktank.com>
We need to verify that a pool really doesn't exist before erroring out. In
particular, we need to make sure it doesn't exist in an osdmap we haven't
seen yet (future from this client's perspective, but still strictly in the
past). The code to do this before was fragile and broken. A 'map latest'
check would go out for every map epoch we process, and we would clear out
our check state on the first reply. Also, we would have to win the race
to get a check back for the exact map that we have before we would succeed.
Instead:
- If we haven't already done so, ask the monitor for the latest map. This
establishes an upper bound on the current map at the time the request
was queued.
- On reply, make note of this map.
- Thereafter, we can fail the request if at any point we call into the
check_*_pool_dne() helper and the current map is >= that bound map. The
caller performs the actual check for whether the pool exists or not.
Among other things, this fixes testrados_list_parallel.
Signed-off-by: Sage Weil <sage@inktank.com>
This was only added so that crash dumps pasted into redmine would link
properly, but those links don't work in redmine right now anyway, so drop
it. The prefix makes it harder to manually cut and paste.
Signed-off-by: Sage Weil <sage@inktank.com>
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>
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>
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.
Signed-off-by: Sage Weil <sage@inktank.com>
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.
Signed-off-by: Sage Weil <sage@inktank.com>