]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
12 years agolibrbd: make rollback use new striping accessors
Sage Weil [Wed, 3 Oct 2012 22:11:08 +0000 (15:11 -0700)]
librbd: make rollback use new striping accessors

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agolibrbd: make trim_image() behave with new world striping order
Sage Weil [Wed, 3 Oct 2012 22:09:48 +0000 (15:09 -0700)]
librbd: make trim_image() behave with new world striping order

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agolibrbd: generate format_string in ImageCtx
Sage Weil [Thu, 4 Oct 2012 18:04:53 +0000 (11:04 -0700)]
librbd: generate format_string in ImageCtx

Prebuild the format string on image load so that it is handy at all times.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agolibrbd: make read_iterate iterate over periods
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.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agolibrbd/ImageCtx: accessors
Sage Weil [Wed, 3 Oct 2012 22:09:25 +0000 (15:09 -0700)]
librbd/ImageCtx: accessors

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agolibrbd: reimplement striping
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.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agofiler: add sparse result into a striped read result
Sage Weil [Tue, 2 Oct 2012 23:00:29 +0000 (16:00 -0700)]
filer: add sparse result into a striped read result

Add a helper to assimilate a sparse read result into the destriper
helper class.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agofiler: make tail zeroing in stripe result assembly optional
Sage Weil [Tue, 2 Oct 2012 22:37:41 +0000 (15:37 -0700)]
filer: make tail zeroing in stripe result assembly optional

Objecter doesn't want it, librbd will.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agolibrbd: remove callback from handle_sparse_read
Sage Weil [Tue, 2 Oct 2012 22:22:34 +0000 (15:22 -0700)]
librbd: remove callback from handle_sparse_read

We always used simple_read_cb, so put it inline.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoobjecter: use StripedReadResult for scatter/gather read
Sage Weil [Tue, 2 Oct 2012 21:53:24 +0000 (14:53 -0700)]
objecter: use StripedReadResult for scatter/gather read

This vastly simplifies the code, and uses the more generic helper class.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agofiler: helper to assemble striped read results into a single result
Sage Weil [Tue, 2 Oct 2012 21:44:54 +0000 (14:44 -0700)]
filer: helper to assemble striped read results into a single result

This is intended to replace the Objecter::_sg_read_finish() monstrosity,
and be reused by the librbd striping code.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agobuffer: add claim_prepend()
Sage Weil [Tue, 2 Oct 2012 21:30:27 +0000 (14:30 -0700)]
buffer: add claim_prepend()

Steal another bufferlist's content and prepend it to our own.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agofiler: add optional buffer offset
Sage Weil [Tue, 2 Oct 2012 21:02:06 +0000 (14:02 -0700)]
filer: add optional buffer offset

It may be that some range is being mapped that is intended for some offset
within the result buffer.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agofiler: add helper to map from object extent to file extents
Sage Weil [Sat, 6 Oct 2012 00:34:19 +0000 (17:34 -0700)]
filer: add helper to map from object extent to file extents

Given an extent in an object and a layout, map it back to extent(s) in the
original file.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agofiler: use vector<pair<>> instead of map<> for buffer extent map
Sage Weil [Sat, 6 Oct 2012 00:37:31 +0000 (17:37 -0700)]
filer: use vector<pair<>> instead of map<> for buffer extent map

This is less inefficient.  :)

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agofiler: include (numeric) objectno in ObjectExtent
Sage Weil [Tue, 2 Oct 2012 15:45:05 +0000 (08:45 -0700)]
filer: include (numeric) objectno in ObjectExtent

This lets us map backwards, if we need to.  Arguably the oid and oloc
don't belong here at all.  That can come later.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agolibrbd: update python bindings for striped image creation
Sage Weil [Tue, 2 Oct 2012 03:59:20 +0000 (20:59 -0700)]
librbd: update python bindings for striped image creation

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agorbd: document stripe unit options on man page
Sage Weil [Tue, 2 Oct 2012 03:57:33 +0000 (20:57 -0700)]
rbd: document stripe unit options on man page

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agolibrbd: document create3
Sage Weil [Tue, 2 Oct 2012 03:55:28 +0000 (20:55 -0700)]
librbd: document create3

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agolibrbd: populate struct ceph_file_layout for image
Sage Weil [Tue, 2 Oct 2012 00:05:48 +0000 (17:05 -0700)]
librbd: populate struct ceph_file_layout for image

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agofiler: generalize file_to_extents to take a format string
Sage Weil [Mon, 1 Oct 2012 23:00:28 +0000 (16:00 -0700)]
filer: generalize file_to_extents to take a format string

Allow any format string to be used, so long as it takes a long long
unsigned.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agorbd: show striping parameters with 'info' command
Sage Weil [Mon, 1 Oct 2012 22:32:13 +0000 (15:32 -0700)]
rbd: show striping parameters with 'info' command

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agolibrbd: expose image striping properties
Sage Weil [Mon, 1 Oct 2012 22:31:40 +0000 (15:31 -0700)]
librbd: expose image striping properties

Fix C and C++ APIs.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agocls_rbd: fix snap key filtering
Sage Weil [Mon, 1 Oct 2012 22:26:53 +0000 (15:26 -0700)]
cls_rbd: fix snap key filtering

Ignore any omap keys that don't begin with "snap_".  We got away with this
previously because it was (lexiographically) the last key for the object.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agorbd: allow striping to be specified on image creation
Sage Weil [Mon, 1 Oct 2012 21:46:44 +0000 (14:46 -0700)]
rbd: allow striping to be specified on image creation

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agolibrbd: allow striping to be specified on image creation
Sage Weil [Mon, 1 Oct 2012 21:46:34 +0000 (14:46 -0700)]
librbd: allow striping to be specified on image creation

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agolibrbd: load striping information when opening image
Sage Weil [Fri, 5 Oct 2012 23:57:16 +0000 (16:57 -0700)]
librbd: load striping information when opening image

Silently tolerate an -ENOEXEC or -EINVAL (which means striping is not
present or is not supported by the osd class).

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agocls_rbd: add stripe_unit, stripe_count metadata
Sage Weil [Fri, 5 Oct 2012 23:56:33 +0000 (16:56 -0700)]
cls_rbd: add stripe_unit, stripe_count metadata

* add STRIPINGV2 feature
* add stripe_unit, stripe_count keys
* add accessor methods

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoclient: avoid possible null deref
Sage Weil [Mon, 15 Oct 2012 21:22:31 +0000 (14:22 -0700)]
client: avoid possible null deref

CID 716910 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)
At (6): Dereferencing null pointer "mds_session".

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoclient: fix shadowing in inode ctor
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.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoclient: init readdir fields
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.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agocls_rgw: init var in ctor
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.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agorgw: don't add port to url if already has one
Yehuda Sadeh [Mon, 15 Oct 2012 16:43:47 +0000 (09:43 -0700)]
rgw: don't add port to url if already has one

Fixes: #3296
Specifically, is host name string already has ':', then
don't try to append theport (swift auth).

backport: argonaut
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agoceph-disk-prepare, debian/control: Support external journals.
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>
12 years agologrotate: fix bash syntax
Chris Dunlop [Sun, 14 Oct 2012 05:33:47 +0000 (22:33 -0700)]
logrotate: fix bash syntax

Introduced by 32a6394be0725b4742ebe87d7537b98c7025e4f6.

Signed-off-by: Chris Dunlop <chris@onthe.net.au>
12 years agodoc: remove cephfs warning
Sage Weil [Sun, 14 Oct 2012 03:13:35 +0000 (20:13 -0700)]
doc: remove cephfs warning

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agodoc: fix file system recs
Sage Weil [Sun, 14 Oct 2012 03:12:48 +0000 (20:12 -0700)]
doc: fix file system recs

- drop xattr warning; this is not an issue with the leveldb stuff.
- the ext3 vs xattr discussion was somewhat inaccurate.  also, no longer
  relevant.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agorgw: replace bucket creation with explicit pool creation
Yehuda Sadeh [Fri, 12 Oct 2012 21:01:03 +0000 (14:01 -0700)]
rgw: replace bucket creation with explicit pool creation

Following a recent cleanup, usage should create a pool and
not a bucket.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agoMerge branch 'wip-fix-getdents'
Sam Lang [Thu, 11 Oct 2012 19:19:04 +0000 (14:19 -0500)]
Merge branch 'wip-fix-getdents'

12 years agorbd: don't issue usage on errors
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>
12 years agoMerge branch 'master' of https://github.com/ceph/ceph
John Wilkins [Wed, 10 Oct 2012 22:16:17 +0000 (15:16 -0700)]
Merge branch 'master' of https://github.com/ceph/ceph

12 years agodoc: Added radosgw temp remove.
John Wilkins [Wed, 10 Oct 2012 22:15:32 +0000 (15:15 -0700)]
doc: Added radosgw temp remove.

fixes: #3278

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agodoc: Minor clean-up.
John Wilkins [Wed, 10 Oct 2012 22:14:05 +0000 (15:14 -0700)]
doc: Minor clean-up.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agodoc: minor clean-up.
John Wilkins [Wed, 10 Oct 2012 22:13:41 +0000 (15:13 -0700)]
doc: minor clean-up.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agorgw: fix compilation
Noah Watkins [Wed, 10 Oct 2012 21:59:16 +0000 (14:59 -0700)]
rgw: fix compilation

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
12 years agoMerge branch 'master' of https://github.com/ceph/ceph
John Wilkins [Wed, 10 Oct 2012 21:38:50 +0000 (14:38 -0700)]
Merge branch 'master' of https://github.com/ceph/ceph

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agoMerge branch 'master' of https://github.com/ceph/ceph
John Wilkins [Wed, 10 Oct 2012 21:36:51 +0000 (14:36 -0700)]
Merge branch 'master' of https://github.com/ceph/ceph

12 years agoMerge branch 'wip-rbd-openstack-doc'
John Wilkins [Wed, 10 Oct 2012 21:36:13 +0000 (14:36 -0700)]
Merge branch 'wip-rbd-openstack-doc'

12 years agomon: drop command replies on paxos reset
Sage Weil [Tue, 9 Oct 2012 00:14:22 +0000 (17:14 -0700)]
mon: drop command replies on paxos reset

If paxos resets, do not send the reply for the commit we were waiting for;
let the command be reprocessed and re-proposed.

Among other things, this could lead to nondeterministic results for
'ceph osd create <uuid>'.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agodoc: Editing and cleanup.
John Wilkins [Wed, 10 Oct 2012 20:22:47 +0000 (13:22 -0700)]
doc: Editing and cleanup.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agotest: Allow randomized tests to be repeatable
Sam Lang [Wed, 10 Oct 2012 02:11:19 +0000 (21:11 -0500)]
test: Allow randomized tests to be repeatable

Outputs the random number used for the Dir_ls
test and allows setting the value through an
environment variable.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agoclient: Reset cache_name pos on dirp
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.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agorbd cli tests: copy.sh was looking for old version of rbd ls -l output
Dan Mick [Wed, 10 Oct 2012 00:13:03 +0000 (17:13 -0700)]
rbd cli tests: copy.sh was looking for old version of rbd ls -l output

Signed-off-by: Dan Mick <dan.mick@inktank.com>
12 years agoclean up of rbd functionality script
tamil [Tue, 9 Oct 2012 23:42:57 +0000 (16:42 -0700)]
clean up of rbd functionality script

Signed-off-by: tamil <tamil.muthamizhan@inktank.com>
12 years agocleaned up the perl module
tamil [Tue, 9 Oct 2012 23:40:55 +0000 (16:40 -0700)]
cleaned up the perl module

Signed-off-by: tamil <tamil.muthamizhan@inktank.com>
12 years agocleaned up the script
tamil [Tue, 9 Oct 2012 22:50:29 +0000 (15:50 -0700)]
cleaned up the script

Signed-off-by: tamil <tamil.muthamizhan@inktank.com>
12 years agoradosgw-admin: don't try to parse date if wasn't specified
Yehuda Sadeh [Tue, 9 Oct 2012 21:56:28 +0000 (14:56 -0700)]
radosgw-admin: don't try to parse date if wasn't specified

This fixes a regression following the merge of wip-admin-rest.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agoceph-debugpack: updates
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

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agodoc: separate config from I/O in openstack diagram
Josh Durgin [Tue, 9 Oct 2012 21:06:40 +0000 (14:06 -0700)]
doc: separate config from I/O in openstack diagram

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agodoc: clarify rbd openstack docs
Josh Durgin [Tue, 9 Oct 2012 20:53:37 +0000 (13:53 -0700)]
doc: clarify rbd openstack docs

* give upstart example
* restart all relevant services
* explain OpenStack terminology more

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agogitignore: Update to match packaging changes and additions, rest-bench addition.
Tommi Virtanen [Tue, 9 Oct 2012 20:23:37 +0000 (13:23 -0700)]
gitignore: Update to match packaging changes and additions, rest-bench addition.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
12 years agoconfigure.ac: Typo in human-readable description.
Tommi Virtanen [Tue, 9 Oct 2012 19:47:22 +0000 (12:47 -0700)]
configure.ac: Typo in human-readable description.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
12 years agomon: Monitor: resolve keyring option to a file before loading keyring
Joao Eduardo Luis [Tue, 9 Oct 2012 20:25:54 +0000 (21:25 +0100)]
mon: Monitor: resolve keyring option to a file before loading keyring

Otherwise our keyring default location, or any other similarly formatted
location, will be taken as the actual location for the keyring and fail.

Reported-by: tziOm (at) #ceph
Fixes: 3276
Backport: argonaut

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
12 years agodoc: simplify wording for rbd-openstack config
Josh Durgin [Tue, 9 Oct 2012 17:34:51 +0000 (10:34 -0700)]
doc: simplify wording for rbd-openstack config

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agoMerge remote-tracking branch 'gh/wip-gtest-libcephfs'
Sage Weil [Tue, 9 Oct 2012 16:43:42 +0000 (09:43 -0700)]
Merge remote-tracking branch 'gh/wip-gtest-libcephfs'

Reviewed-by: Sage Weil <sage@inktank.com>
12 years agodoc: Add doxygen style documentation for libcephfs
Sam Lang [Tue, 9 Oct 2012 14:09:37 +0000 (09:09 -0500)]
doc: Add doxygen style documentation for libcephfs

As well as doxygen doc, we document a few parts of
the interface that are otherwise undocumented and
don't match the standard calls.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agotest: Refactored testceph.cc into gtest framework
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.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agotest: Allow readdir test to be repeated
Sam Lang [Tue, 9 Oct 2012 14:14:35 +0000 (09:14 -0500)]
test: Allow readdir test to be repeated

Use test dir/files that include the pid to avoid
hitting errors when running the same test twice.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agolibcephfs: Check that buffer is non-null
Sam Lang [Tue, 9 Oct 2012 14:11:37 +0000 (09:11 -0500)]
libcephfs: Check that buffer is non-null

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agoMerge remote-tracking branch 'gh/wip-client-stale'
Sage Weil [Tue, 9 Oct 2012 03:56:05 +0000 (20:56 -0700)]
Merge remote-tracking branch 'gh/wip-client-stale'

Reviewed-by: Sage Weil <sage@inktank.com>
12 years agomds: Fix removexattr ENODATA error
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>
12 years agoosdmap: fix null deref in dump
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.)

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosdmap: fix osdmap dump null check
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.

Broken by 13b841c74605d67a172d787079bcef007d1a8fa5.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: note fall-thru to please coverity
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.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agotest_cfuse_cache_invalidate: check for errors
Sage Weil [Tue, 9 Oct 2012 03:47:16 +0000 (20:47 -0700)]
test_cfuse_cache_invalidate: check for errors

CID 731941 (#1 of 2): Argument cannot be negative (NEGATIVE_RETURNS)
At (6): "fd" is passed to a parameter that cannot be negative.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon/Elector: fix leak on monmap from peer
Sage Weil [Tue, 9 Oct 2012 03:44:54 +0000 (20:44 -0700)]
mon/Elector: fix leak on monmap from peer

CID 731942 (#1 of 1): Resource leak (RESOURCE_LEAK)
At (12): Variable "peermap" going out of scope leaks the storage it points to.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agotest_cfuse_cache_invalidate: zero buffer
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)".

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoFileJournal: ignore osd journal size for block devices
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>
12 years agorgw: switch perm to uint32_t
Yehuda Sadeh [Mon, 8 Oct 2012 23:34:12 +0000 (16:34 -0700)]
rgw: switch perm to uint32_t

Should fix a warning.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: flexible attr fields
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.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: get bucket logging stub
Yehuda Sadeh [Wed, 26 Sep 2012 23:41:17 +0000 (16:41 -0700)]
rgw: get bucket logging stub

Trivial implementation that just returns that
bucket logging is not enabled.

Fixes: #3225
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: check_disk_state also updates other object metadata
Yehuda Sadeh [Fri, 28 Sep 2012 18:11:04 +0000 (11:11 -0700)]
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).

Fixes: #3234
Backport: argonaut
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agoMerge branch 'wip-rgw-coverity2'
Yehuda Sadeh [Mon, 8 Oct 2012 22:23:08 +0000 (15:23 -0700)]
Merge branch 'wip-rgw-coverity2'

12 years agorgw: set null termination explicitly
Yehuda Sadeh [Thu, 27 Sep 2012 23:02:21 +0000 (16:02 -0700)]
rgw: set null termination explicitly

Make sure that string is null terminated.
Fixes coverity issue.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agocls_rgw: return returned ret code
Yehuda Sadeh [Thu, 27 Sep 2012 22:33:28 +0000 (15:33 -0700)]
cls_rgw: return returned ret code

Wasn't setting the ret code. A coverity issue.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: add missing parantheses
Yehuda Sadeh [Thu, 27 Sep 2012 22:30:16 +0000 (15:30 -0700)]
rgw: add missing parantheses

.. around logic operations at process_intent_log().
Another coverity fix.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: check NULL before dereference
Yehuda Sadeh [Thu, 27 Sep 2012 22:27:00 +0000 (15:27 -0700)]
rgw: check NULL before dereference

Another coverity fix.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw-admin: pass object by reference
Yehuda Sadeh [Thu, 27 Sep 2012 22:24:45 +0000 (15:24 -0700)]
rgw-admin: pass object by reference

Large object should be passed by reference (coverity fix).

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: fix leaks in certain error paths
Yehuda Sadeh [Thu, 27 Sep 2012 22:13:46 +0000 (15:13 -0700)]
rgw: fix leaks in certain error paths

Fixes a few coverity issues

Conflicts:
src/rgw/rgw_rados.cc

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: fix (im)possible leak
Yehuda Sadeh [Thu, 27 Sep 2012 22:00:09 +0000 (15:00 -0700)]
rgw: fix (im)possible leak

Fixes coverity issue

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: catch possible exception
Yehuda Sadeh [Thu, 27 Sep 2012 21:58:12 +0000 (14:58 -0700)]
rgw: catch possible exception

Fix coverity issue 717168.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: initialize member variables at req_state
Yehuda Sadeh [Thu, 27 Sep 2012 21:50:56 +0000 (14:50 -0700)]
rgw: initialize member variables at req_state

Fixes more coverity issues

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: initialize data members
Yehuda Sadeh [Thu, 27 Sep 2012 21:43:53 +0000 (14:43 -0700)]
rgw: initialize data members

Fixes a few coverity issues.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: RGWObjState() initialize memebers
Yehuda Sadeh [Thu, 27 Sep 2012 21:38:21 +0000 (14:38 -0700)]
rgw: RGWObjState() initialize memebers

Initialize members at constructor. Fixes coverity issues.

Conflicts:
src/rgw/rgw_rados.h

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: initialize members at RGWRados()
Yehuda Sadeh [Thu, 27 Sep 2012 21:35:35 +0000 (14:35 -0700)]
rgw: initialize members at RGWRados()

fixes coverity issues

Conflicts:
src/rgw/rgw_rados.h

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agocls_rgw: check pointer before dereferencing
Yehuda Sadeh [Thu, 27 Sep 2012 21:29:55 +0000 (14:29 -0700)]
cls_rgw: check pointer before dereferencing

Fixes coverity issue 719577

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: multiple coverity fixes of uninitialized fields
Yehuda Sadeh [Thu, 27 Sep 2012 20:14:37 +0000 (13:14 -0700)]
rgw: multiple coverity fixes of uninitialized fields

Fields were not initialized explicitly by constractor.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: trivial fix
Yehuda Sadeh [Thu, 27 Sep 2012 20:09:36 +0000 (13:09 -0700)]
rgw: trivial fix

fix coverity issue 728052

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: change size_t to ssize_t for string.rfind() result
Yehuda Sadeh [Thu, 27 Sep 2012 20:07:14 +0000 (13:07 -0700)]
rgw: change size_t to ssize_t for string.rfind() result

fixes coverity bug 728053

string.rfind() may return negative value, switch to ssize_t instead
of size_t.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: fix resource leak
Yehuda Sadeh [Thu, 27 Sep 2012 19:44:33 +0000 (12:44 -0700)]
rgw: fix resource leak

coverity bug 728055

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>