Commit Graph

21946 Commits

Author SHA1 Message Date
Sam Lang
809587c915 client: Implement lchown in Client and libcephfs
Signed-off-by: Sam Lang <sam.lang@inktank.com>
2012-10-17 12:50:48 -05:00
Sam Lang
39fcd7e273 test: Add libcephfs tests for stat, lstat, chmod
Signed-off-by: Sam Lang <sam.lang@inktank.com>
2012-10-17 12:50:48 -05:00
Sam Lang
9b0c88bf13 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.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
2012-10-17 12:50:48 -05:00
Sam Lang
14ef165534 client: Support for fchmod
Signed-off-by: Sam Lang <sam.lang@inktank.com>
2012-10-17 12:50:47 -05:00
Sage Weil
e6cecabb55 Merge remote-tracking branch 'gh/mon-coverity-fixes'
Reviewed-by: Sage Weil <sage@inktank.com>
2012-10-17 09:59:19 -07:00
Joao Eduardo Luis
a0f65a161a mon: MonitorStore: check return value of 'rename' for errors
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>
2012-10-17 17:47:55 +01:00
Joao Eduardo Luis
e41caa190d 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>
2012-10-17 17:47:55 +01:00
Joao Eduardo Luis
2549bb869a 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>
2012-10-17 17:47:55 +01:00
Joao Eduardo Luis
6d7dea3588 mon: AuthMonitor: check return values
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>
2012-10-17 17:47:54 +01:00
Joao Eduardo Luis
0292349dfd mon: LogMonitor: check return value when writing to file
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>
2012-10-17 15:41:36 +01:00
Joao Eduardo Luis
47a4a7c6e0 mon: Monitor: unlock before returning
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>
2012-10-17 15:31:44 +01:00
Joao Eduardo Luis
52dedc8986 mon: Monitor: fix potential null-pointer dereference
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>
2012-10-17 15:23:11 +01:00
Sage Weil
64bf7f9b28 leveldb: update .gitignore
Signed-off-by: Sage Weil <sage@inktank.com>
2012-10-16 21:29:34 -07:00
Sage Weil
bcd6aea3c9 monclient: drop now-unused MonClient::is_latest_map()
Any sensible caller probably wants to use get_version() directly.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-10-16 21:13:54 -07:00
Sage Weil
ad6840ce5c Merge branch 'wip-3301'
Reviewed-by: Sage Weil <sage@inktank.com>
2012-10-16 21:06:00 -07:00
Sam Lang
8ed86eea3f test: Add func. test for chmod in libcephfs
Signed-off-by: Sam Lang <sam.lang@inktank.com>
2012-10-16 18:26:29 -07:00
Sam Lang
328bf48234 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.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
2012-10-16 18:26:29 -07:00
Dan Mick
ee20cd02ab rbd: reject negative size (can make image that is hard to delete)
Signed-off-by: Dan Mick <dan.mick@inktank.com>
2012-10-16 18:25:52 -07:00
Sage Weil
8791db7453 qa: run multiprocess rados tests
These now pass, except for the watch/notify one.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-10-16 17:52:26 -07:00
Sage Weil
935d579dde testrados_watch_notify: fix most tests, disable one
The last test is disabled until #2339 is resolved.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-10-16 17:52:26 -07:00
Sage Weil
c9de24f9ca testrados_list_parallel: fix
- 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>
2012-10-16 17:52:25 -07:00
Sage Weil
cce58a31e8 objecter: refactor pool dne checks
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>
2012-10-16 17:52:25 -07:00
Sage Weil
dc2ec37800 objecter: fix handling for pool DNE on pgls
Fix check for whther the pool exists for pgls.  This was broken ages ago by
e0ec286501.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-10-16 17:52:25 -07:00
Sage Weil
ed46a85b89 version: drop 'commit:' prefix on sha1
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>
2012-10-16 17:52:25 -07:00
Sage Weil
6f74e6b36a radosgw: fix compile warning
Signed-off-by: Sage Weil <sage@inktank.com>
2012-10-16 17:27:28 -07:00
Gary Lowell
d78ba6af94 Merge branch 'next' 2012-10-16 23:27:21 +00:00
John Wilkins
ab4d8b75f3 doc: Updated the cephx section of the toc for cluster ops.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2012-10-16 15:24:11 -07:00
John Wilkins
256c665eab doc: Did a little clean-up work in the cephx guide.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2012-10-16 15:23:34 -07:00
John Wilkins
0818e1e95a doc: Added a new intro for cephx authentication.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2012-10-16 15:22:25 -07:00
Yehuda Sadeh
d2afddd457 rgw: multiple coverity fixes
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-16 14:13:38 -07:00
Sam Lang
58020d44c7 test: Add a workunit for chmod
Signed-off-by: Sam Lang <sam.lang@inktank.com>
2012-10-16 15:17:38 -05:00
Sage Weil
db976663a5 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>
2012-10-16 13:04:43 -07:00
Sage Weil
2542dd5364 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>
2012-10-16 11:47:29 -07:00
Sage Weil
b290dc3a30 MClientRequest: fix mode formatting
Signed-off-by: Sage Weil <sage@inktank.com>
2012-10-16 11:11:16 -07:00
Gary Lowell
2528b5ee10 v0.43 2012-10-16 17:42:36 +00:00
Sage Weil
318bd19275 Merge remote-tracking branch 'gh/wip-fedora18' into next 2012-10-16 09:05:55 -07:00
Dan Mick
96e365be85 radosgw-admin manpage: Fix broken quotes
Signed-off-by: Dan Mick <dan.mick@inktank.com>
2012-10-15 18:18:49 -07:00
Sage Weil
412efc1681 admin_socket: fix '0' protocol version
Broken by 895e24d198.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-10-15 16:37:24 -07:00
Sage Weil
a43ba9ae24 rbd: fix striping feature bit addition
Add the STRIPINGV2 feature bit when striping is non-default.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-10-15 15:34:07 -07:00
Sage Weil
7957500566 librbd: log why create failed when striping features missing
Signed-off-by: Sage Weil <sage@inktank.com>
2012-10-15 15:34:07 -07:00
Sage Weil
b7682c5d90 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.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-10-15 15:34:07 -07:00
Sage Weil
d68a80622c 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.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-10-15 15:34:07 -07:00
Sage Weil
5599eb7c82 Striper: move from Filer
Move all the static striping code from Filer to Striper.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-10-15 15:34:06 -07:00
Sage Weil
ff304c8010 librbd: implement user-facing image to image copy
copy2, copy_with_progress2

Signed-off-by: Sage Weil <sage@inktank.com>
2012-10-15 15:34:06 -07:00
Sage Weil
6242059900 librbd: factor out copy from image create/open/close
Signed-off-by: Sage Weil <sage@inktank.com>
2012-10-15 15:34:06 -07:00
Sage Weil
5d5863c6df librbd: rename get_size() -> get_current_size()
Signed-off-by: Sage Weil <sage@inktank.com>
2012-10-15 15:34:06 -07:00
Sage Weil
c7b5cdf8e0 filer: trivial unit test
Perhaps the presence of this file will inspire me and others to write
proper unit tests.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-10-15 15:34:06 -07:00
Sage Weil
17bb2c500f osd: include buffer_extents in ObjectExtent operator<<
Signed-off-by: Sage Weil <sage@inktank.com>
2012-10-15 15:34:06 -07:00
Sage Weil
e6c98e94dc filer: more debug output
Signed-off-by: Sage Weil <sage@inktank.com>
2012-10-15 15:34:06 -07:00
Sage Weil
b4f28292c2 filer: fix add_partial_sparse_result
Fix advancement of bl_off, and handling of case where bl has no more bytes
to consume.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-10-15 15:34:06 -07:00