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, 15 Oct 2012 21:20:51 +0000 (14:20 -0700)]
client: fix shadowing in inode ctor
CID 728080 (#1 of 1): Incorrect sizeof expression (BAD_SIZEOF)
Taking the size of pointer parameter "layout" is suspicious.
At (2): Non-static class member field "layout.fl_stripe_unit" is not initialized in this constructor nor in any functions that it calls.
At (4): Non-static class member field "layout.fl_stripe_count" is not initialized in this constructor nor in any functions that it calls.
At (6): Non-static class member field "layout.fl_object_size" is not initialized in this constructor nor in any functions that it calls.
At (8): Non-static class member field "layout.fl_cas_hash" is not initialized in this constructor nor in any functions that it calls.
At (10): Non-static class member field "layout.fl_object_stripe_unit" is not initialized in this constructor nor in any functions that it calls.
At (12): Non-static class member field "layout.fl_unused" is not initialized in this constructor nor in any functions that it calls.
CID 717206 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
At (14): Non-static class member field "layout.fl_pg_pool" is not initialized in this constructor nor in any functions that it calls.
Sage Weil [Mon, 15 Oct 2012 21:19:10 +0000 (14:19 -0700)]
client: init readdir fields
At (2): Non-static class member "readdir_offset" is not initialized in this constructor nor in any functions that it calls.
At (4): Non-static class member "readdir_end" is not initialized in this constructor nor in any functions that it calls.
At (6): Non-static class member "readdir_num" is not initialized in this constructor nor in any functions that it calls.
CID 717207 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
At (8): Non-static class member "tid" is not initialized in this constructor nor in any functions that it calls.
Sage Weil [Mon, 15 Oct 2012 21:14:28 +0000 (14:14 -0700)]
cls_rgw: init var in ctor
CID 727992 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
At (2): Non-static class member "tag_timeout" is not initialized in this constructor nor in any functions that it calls.
Tommi Virtanen [Fri, 5 Oct 2012 17:57:42 +0000 (10:57 -0700)]
ceph-disk-prepare, debian/control: Support external journals.
Previously, ceph-disk-* would only let you use a journal that was a
file inside the OSD data directory. With this, you can do:
ceph-disk-prepare /dev/sdb /dev/sdb
to put the journal as a second partition on the same disk as the OSD
data (might save some file system overhead), or, more interestingly:
ceph-disk-prepare /dev/sdb /dev/sdc
which makes it create a new partition on /dev/sdc to use as the
journal. Size of the partition is decided by $osd_journal_size.
/dev/sdc must be a GPT-format disk. Multiple OSDs may share the same
journal disk (using separate partitions); this way, a single fast SSD
can serve as journal for multiple spinning disks.
The second use case currently requires parted, so a Recommends: for
parted has been added to Debian packaging.
Closes: #3078 Closes: #3079 Signed-off-by: Tommi Virtanen <tv@inktank.com>
Dan Mick [Wed, 10 Oct 2012 17:41:05 +0000 (10:41 -0700)]
rbd: don't issue usage on errors
Change bare calls to usage() to an informative targeted error message
Remove all calls to usage() except when requested with -h/--help
Regularize all errors to start with rbd:
Remove a few commented cerrs, wrap cerr calls at 80 cols
Signed-off-by: Dan Mick <dan.mick@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Sam Lang [Tue, 9 Oct 2012 22:34:48 +0000 (17:34 -0500)]
client: Reset cache_name pos on dirp
Reset the at_cache_name field on the directory
stream pointer for rewinddir.
This fixes a bug where getdents after readdir at
the end of the stream would return invalid
results after rewinddir had been called.
Sage Weil [Tue, 9 Oct 2012 21:10:48 +0000 (14:10 -0700)]
ceph-debugpack: updates
- avoid copying data around; tar things directly into the tgz
- 'ceph report' instead of all the little bits
- unrotated logs only
- ensure target doesn't already exist
Sam Lang [Tue, 9 Oct 2012 14:06:16 +0000 (09:06 -0500)]
test: Refactored testceph.cc into gtest framework
Moved all the functionality tests for the libcephfs
API into the gtest framework. Also adds tests for
directories to improve test coverage of the libcephfs
interfaces.
Sam Lang [Mon, 8 Oct 2012 17:04:57 +0000 (12:04 -0500)]
mds: Fix removexattr ENODATA error
If a client sets an xattr and then attempts to remove in a short
time window, the xattr may not have been committed to the journal
and will only be set on the projected xattrs of the inode. This
results in a removexattr returning ENODATA at present. The fix
here checks the xattr name in the projected xattrs, and only
returns ENODATA in the case where the name doesn't exist in that
map either.
Signed-off-by: Sam Lang <sam.lang@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
Sage Weil [Tue, 9 Oct 2012 03:50:12 +0000 (20:50 -0700)]
osdmap: fix null deref in dump
CID 731938 (#1 of 1): Dereference after null check (FORWARD_NULL)
At (15): Passing null pointer "f" to function "ceph::Formatter::dump_int(char const *, int64_t)", which dereferences it. (The dereference happens because this is a virtual function call.)
Sage Weil [Tue, 9 Oct 2012 03:49:41 +0000 (20:49 -0700)]
osdmap: fix osdmap dump null check
CID 731939 (#1 of 1): Dereference after null check (FORWARD_NULL)
At (5): Passing null pointer "out" to function "std::operator << <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> > &, char const *)", which dereferences it.
Sage Weil [Tue, 9 Oct 2012 03:48:30 +0000 (20:48 -0700)]
mds: note fall-thru to please coverity
CID 731940 (#1 of 1): Missing break in switch (MISSING_BREAK)
This case (value 23) is not terminated by a 'break' statement.
1719 case CEPH_MSG_CLIENT_RECONNECT:
1720 ALLOW_MESSAGES_FROM(CEPH_ENTITY_TYPE_CLIENT);
The above case falls through to this one.
Sage Weil [Tue, 9 Oct 2012 03:44:10 +0000 (20:44 -0700)]
test_cfuse_cache_invalidate: zero buffer
CID 731943 (#1 of 1): Uninitialized scalar variable (UNINIT)
At (5): Using uninitialized element of array "buf" when calling "pwrite(int, void const *, size_t, __off64_t)".
Josh Durgin [Tue, 9 Oct 2012 00:59:36 +0000 (17:59 -0700)]
FileJournal: ignore osd journal size for block devices
Using part of a block device doesn't make much sense. This makes the
common case, where you partition a disk to act as several journals,
easier to configure.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
Yehuda Sadeh [Mon, 8 Oct 2012 23:13:04 +0000 (16:13 -0700)]
rgw: flexible attr fields
Fixes: #3114
Instead of having a few hard coded attrs that are
special cased, make it more generic. This allows supporting
more header fields, such as cache-control, expires, etc.