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.
rgw: check_disk_state also updates other object metadata
When we do a check_disk_state() on an object that is not complete,
we need to also update etag, content_type, owner, and display_name.
Otherwise, we'd end up missing that from the bucket index. In
practice this only affects swift, as only there we're actually
looking at that info (when listing a container).
oneiric, where the doc gitbuilder runs, doesn't have the
--system-site-packages option; let's get docs back and sort this out
offline. (virtualenv 1.6.4-0ubuntu1 on oneiric, 1.7.1.2-1 on precise)
We didn't update buffer size according to read data.
Also, didn't update the total obj_size (was doing it only
for the second chunk being put, but for chunked input that
only had a single piece we ended up with zero obj_size). Also
remove assertion that second call to handle_data() means that
ofs > chunk size. This isn't true for chunked input.
rgw: abort_early should initialize formatter if needed
The formatter might not have been initialized, as we
abort early (e.g., when protocol handler wasn't found)
so we need to initialize it in order to dump error
status.
rgw: tie callbacks in different handlers directly to REST
Don't translate RESTful operations into a more meaningful
callback name. The handlers themselves should do that
translation. This way we can later register different
handlers with different meanings for the operations.
Sam Lang [Fri, 5 Oct 2012 16:32:33 +0000 (11:32 -0500)]
mds: Reset session stale timer at end of open
The mds gets an open session request and immediately sets the session
stale timer. If logging the session and sending the reply takes longer
than the timer, the client sees a stale session message before getting
the open session reply. This fix resets the session stale timer on
completion of the mds logging operation to reduce the likelihood of
the session getting marked stale before the client can receive the
open session reply and start sending renewcaps messages.
We reset the session timer for renewcaps and force_open_sessions right
before returning the SESSION_OPEN reply to the client. This avoids stale
sessions in the cases where the mds is highly loaded and the session_open
reply back to the client is delayed.
Sage Weil [Fri, 5 Oct 2012 16:10:31 +0000 (09:10 -0700)]
osd: Make --get-journal-fsid not really start the osd.
This way, it won't need -i ID and it won't access the osd_data_dir.
That makes it useful for locating the right osd to use with an
external journal partition.
Tommi Virtanen [Wed, 3 Oct 2012 19:38:38 +0000 (12:38 -0700)]
debian/control, ceph-disk-prepare: Depend on xfsprogs, use xfs by default.
Ext4 as a default is a bad choice, as we don't perform enough QA with
it. To use XFS as the default for ceph-disk-prepare, we need to depend
on xfsprogs.
btrfs-tools is already recommended, so no change there. If you set
osd_fs_type=btrfs, and don't have the package installed, you'll just
get an error message.
Tommi Virtanen [Wed, 3 Oct 2012 15:47:20 +0000 (08:47 -0700)]
ceph-disk-prepare: Avoid triggering activate before prepare is done.
Earlier testing never saw this, but now a mount of a disk triggers a
udev blockdev-added event, causing ceph-disk-activate to run even
before ceph-disk-prepare has had a chance to write the files and
unmount the disk.
Avoid this by using a temporary partition type uuid ("ceph 2 be"), and
only setting it to the permanent ("ceph osd"). The hotplug event won't
match the type uuid, and thus won't trigger ceph-disk-activate.
Tommi Virtanen [Tue, 2 Oct 2012 23:37:07 +0000 (16:37 -0700)]
ceph-disk-activate: Unmount on errors (if it did the mount).
This cleans up the error handling to not leave disks mounted
in /var/lib/ceph/tmp/mnt.* when something fails, e.g. when
the ceph command line tool can't talk to mons.
Tommi Virtanen [Tue, 2 Oct 2012 23:04:15 +0000 (16:04 -0700)]
ceph-disk-prepare: Allow specifying fs type to use.
Either use ceph.conf variable osd_fs_type or command line option
--fs-type=
Default is still ext4, as currently nothing guarantees xfsprogs
or btrfs-tools are installed.
Currently both btrfs and xfs seems to trigger a disk hotplug event at
mount time, thus triggering a useless and unwanted ceph-disk-activate
run. This will be worked around in a later commit.
Currently mkfs and mount options cannot be configured.
Bug: #2549 Signed-off-by: Tommi Virtanen <tv@inktank.com>
Dan Mick [Fri, 5 Oct 2012 18:17:44 +0000 (11:17 -0700)]
rbd: set_conf_param() rewhack:
1) comment set_conf_param and the loop that uses it
2) put back error checking for "called with full param list" in macro
3) make all the loop calls consistent
4) add a third arg placeholder to handle lock remove
Signed-off-by: Dan Mick <dan.mick@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Sam Lang [Fri, 5 Oct 2012 16:10:05 +0000 (11:10 -0500)]
client: Fix assert when stale arrives before open
The client sends an open session request to the mds, which may not
get a chance to reply before the mds timer times out the session and
sends the client a stale message. This fix avoids the assertion by
checking that a pending open session request is in progress.