]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
12 years agomds: Fix replica's allowed caps for filelock in SYNC_LOCK state
Yan, Zheng [Mon, 6 May 2013 02:18:36 +0000 (10:18 +0800)]
mds: Fix replica's allowed caps for filelock in SYNC_LOCK state

For replica, filelock in LOCK_LOCK state doesn't allow Fc cap. So
filelock in LOCK_SYNC_LOCK/LOCK_EXCL_LOCK state shouldn't allow Fc
cap either.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: defer releasing cap if necessary
Yan, Zheng [Mon, 6 May 2013 01:09:59 +0000 (09:09 +0800)]
mds: defer releasing cap if necessary

When inode is freezing or frozen, we defer processing MClientCaps
messages and cap release embedded in requests. The same deferral
logical should also cover MClientCapRelease messages.

12 years agomds: fix Locker::request_inode_file_caps()
Yan, Zheng [Thu, 16 May 2013 17:44:23 +0000 (01:44 +0800)]
mds: fix Locker::request_inode_file_caps()

After sending cache rejoin message, replica need notify auth MDS when
cap_wanted changes. But it can send MInodeFileCaps message only after
receiving auth MDS' rejoin ack. Locker::request_inode_file_caps() has
correct wait logical, but it skips sending MInodeFileCaps message if
the auth MDS is still in rejoin state.

The fix is defer sending MInodeFileCaps message until the auth MDS
is active. It makes the function's wait logical less tricky.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: notify auth MDS when cap_wanted changes
Yan, Zheng [Mon, 6 May 2013 01:17:01 +0000 (09:17 +0800)]
mds: notify auth MDS when cap_wanted changes

So the auth MDS can choose locks' states base on our cap_wanted.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: export CInode:mds_caps_wanted
Yan, Zheng [Mon, 6 May 2013 01:06:52 +0000 (09:06 +0800)]
mds: export CInode:mds_caps_wanted

CInode:mds_caps_wanted is used to keep track of caps wanted by non-auth
MDS. The auth MDS checks it when choosing locks' states.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: export CInode::STATE_NEEDSRECOVER
Yan, Zheng [Mon, 6 May 2013 01:00:19 +0000 (09:00 +0800)]
mds: export CInode::STATE_NEEDSRECOVER

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: send slave request after target MDS is active
Yan, Zheng [Mon, 8 Apr 2013 08:17:11 +0000 (16:17 +0800)]
mds: send slave request after target MDS is active

when failure of peer is detected, MDCache::handle_mds_failure()
checks if there are requests waiting for slave replies from the
failed peer, and adds them to the "wait for active peer" list.
The "retry request" logical only covers slave requests sent before
MDCache::handle_mds_failure() is called. If a slave request was
sent while peer isn't up, we wait for its reply forever.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: unfreeze inode after rename rollback finishes
Yan, Zheng [Sat, 6 Apr 2013 22:35:56 +0000 (06:35 +0800)]
mds: unfreeze inode after rename rollback finishes

we should not wake up the unfreeze waiter while the inode is still
linked to a non-auth dirfrag.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: remove buggy cache rejoin code
Yan, Zheng [Tue, 7 May 2013 00:56:11 +0000 (08:56 +0800)]
mds: remove buggy cache rejoin code

I previously added code to handle a corner case of cache rejoin:
entire subtree, together with the inode subtree root belongs to,
were trimmed between sending cache rejoin and receiving rejoin ack.
In this case, we should send cache expire message to the subtree's
auth MDS. But the code is complete broken, remove it temporarily.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: fix typo in Server::do_rename_rollback
Yan, Zheng [Sun, 7 Apr 2013 06:49:53 +0000 (14:49 +0800)]
mds: fix typo in Server::do_rename_rollback

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: fix import cancel race
Yan, Zheng [Sat, 6 Apr 2013 03:25:15 +0000 (11:25 +0800)]
mds: fix import cancel race

Current code uses import state to detect obsolete import discover/prep
message. it does not work for the case: cancel a subtree import, import
the same subtree again, the discover/prep message for the first import
get dispatched.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: fix straydn race
Yan, Zheng [Fri, 5 Apr 2013 11:50:35 +0000 (19:50 +0800)]
mds: fix straydn race

For unlink/rename request, the target dentry's linkage may change
before all locks are acquired. So we need check if the existing stray
dentry is valid.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: fix slave commit tracking
Yan, Zheng [Wed, 15 May 2013 08:35:39 +0000 (16:35 +0800)]
mds: fix slave commit tracking

MDS may crash after journalling a slave commit, but before sending
commit ack to the master. Later when the MDS restarts, it will not
send commit ack to the master. So the master waits for the commit
ack forever. The fix is remove failed MDS from requests' uncommitted
slave list. When failed MDS recovers, its resolve message will tell
the master which slave requests are not committed. The master will
re-add the recovering MDS to requests' uncommitted slave list if
necessary.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: fix uncommitted master wait
Yan, Zheng [Fri, 5 Apr 2013 06:48:13 +0000 (14:48 +0800)]
mds: fix uncommitted master wait

We may add new waiter while the master is committing. so we should
take the waiters and wake up them when the master is committed.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: adjust subtree auth if import aborts in PREPPED state
Yan, Zheng [Thu, 4 Apr 2013 23:53:39 +0000 (07:53 +0800)]
mds: adjust subtree auth if import aborts in PREPPED state

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: don't stop at export bounds when journaling dir context
Yan, Zheng [Thu, 4 Apr 2013 03:06:09 +0000 (11:06 +0800)]
mds: don't stop at export bounds when journaling dir context

We only journal the finish of exporting subtree, so we shouldn't
consider export bounds as subtree root.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: fix underwater dentry cleanup
Yan, Zheng [Tue, 2 Apr 2013 07:46:51 +0000 (15:46 +0800)]
mds: fix underwater dentry cleanup

If the underwater dentry is a remove link, we shouldn't mark the
inode clean

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: journal new subtrees created by rename
Yan, Zheng [Wed, 20 Mar 2013 07:42:50 +0000 (15:42 +0800)]
mds: journal new subtrees created by rename

this avoids creating bare dirfrags during journal replay.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agoMerge branch 'wip_scrub_tphandle' into next
Samuel Just [Fri, 24 May 2013 03:08:11 +0000 (20:08 -0700)]
Merge branch 'wip_scrub_tphandle' into next

Fixes: #5159
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoPG: ping tphandle during omap loop as well
Samuel Just [Fri, 24 May 2013 00:40:44 +0000 (17:40 -0700)]
PG: ping tphandle during omap loop as well

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoPG: reset timeout in _scan_list for each object, read chunk
Samuel Just [Thu, 23 May 2013 22:24:39 +0000 (15:24 -0700)]
PG: reset timeout in _scan_list for each object, read chunk

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoOSD,PG: pass tphandle down to _scan_list
Samuel Just [Thu, 23 May 2013 22:23:05 +0000 (15:23 -0700)]
OSD,PG: pass tphandle down to _scan_list

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agorgw: iterate usage entries from correct entry
Yehuda Sadeh [Thu, 23 May 2013 04:34:52 +0000 (21:34 -0700)]
rgw: iterate usage entries from correct entry

Fixes: #5152
When iterating through usage entries, and when user id was
provided, we started at the user's first entry and not from
the entry indexed by the request start time.
This commit fixes the issue.

Backport: bobtail

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
12 years agomon: drop unnecessary conditionals
Sage Weil [Thu, 23 May 2013 17:23:43 +0000 (10:23 -0700)]
mon: drop unnecessary conditionals

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMerge pull request #311 from ceph/wip-5102
Sage Weil [Thu, 23 May 2013 17:21:51 +0000 (10:21 -0700)]
Merge pull request #311 from ceph/wip-5102

Reviewed-by: Sage Weil <sage@inktank.com>
12 years agomodified: src/init-ceph.in
Xiaoxi Chen [Thu, 23 May 2013 01:33:27 +0000 (09:33 +0800)]
modified:   src/init-ceph.in
fixed bug in init script, the "df" should be run on remote host by do_cmd,
and use $host instead of "hostname -s"

Signed-off-by: Xiaoxi Chen <xiaoxi.chen@intel.com>
(cherry picked from commit 1dd99f0fc91ee6d417325689f24601aa335b94c2)

Conflicts:

src/init-ceph.in

12 years agoosd: skip mark-me-down message if osd is not up
Sage Weil [Wed, 22 May 2013 22:03:50 +0000 (15:03 -0700)]
osd: skip mark-me-down message if osd is not up

Fixes crash when the OSD has not successfully booted and gets a
SIGINT or SIGTERM.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosd, mds: shut down async signal handler on exit
Sage Weil [Wed, 22 May 2013 21:56:24 +0000 (14:56 -0700)]
osd, mds: shut down async signal handler on exit

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomessages/MOSDMarkMeDown: fix uninit field
Sage Weil [Wed, 22 May 2013 21:29:37 +0000 (14:29 -0700)]
messages/MOSDMarkMeDown: fix uninit field

Fixes valgrind warning:
==14803== Use of uninitialised value of size 8
==14803==    at 0x12E7614: sctp_crc32c_sb8_64_bit (sctp_crc32.c:567)
==14803==    by 0x12E76F8: update_crc32 (sctp_crc32.c:609)
==14803==    by 0x12E7720: ceph_crc32c_le (sctp_crc32.c:733)
==14803==    by 0x105085F: ceph::buffer::list::crc32c(unsigned int) (buffer.h:427)
==14803==    by 0x115D7B2: Message::calc_front_crc() (Message.h:441)
==14803==    by 0x1159BB0: Message::encode(unsigned long, bool) (Message.cc:170)
==14803==    by 0x1323934: Pipe::writer() (Pipe.cc:1524)
==14803==    by 0x13293D9: Pipe::Writer::entry() (Pipe.h:59)
==14803==    by 0x120A398: Thread::_entry_func(void*) (Thread.cc:41)
==14803==    by 0x503BE99: start_thread (pthread_create.c:308)
==14803==    by 0x6C6E4BC: clone (clone.S:112)

Backport: cuttlefish
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMerge pull request #316 from ceph/wip-sysvinit
Sage Weil [Wed, 22 May 2013 20:25:42 +0000 (13:25 -0700)]
Merge pull request #316 from ceph/wip-sysvinit

Reviewed-by: Dan Mick <dan.mick@inktank.com>
12 years agosysvinit: fix osd weight calculation on remote hosts 316/head
Sage Weil [Wed, 22 May 2013 16:47:29 +0000 (09:47 -0700)]
sysvinit: fix osd weight calculation on remote hosts

We need to do df on the remote host, not locally.

Simlarly, the ceph command uses the osd key, which exists remotely; run it there.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agosysvinit: use known hostname $host instead of (incorrectly) recalculating
Sage Weil [Wed, 22 May 2013 16:47:03 +0000 (09:47 -0700)]
sysvinit: use known hostname $host instead of (incorrectly) recalculating

We would need to do hostname -s on the remote node, not the local one.
But we already have $host; use it!

Reported-by: Xiaoxi Chen <xiaoxi.chen@intel.com>
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoOSDMonitor: skip new pools in update_pools_status() and get_pools_health()
Samuel Just [Tue, 21 May 2013 22:22:56 +0000 (15:22 -0700)]
OSDMonitor: skip new pools in update_pools_status() and get_pools_health()

New pools won't be full.  mon->pgmon()->pg_map.pg_pool_sum[poolid] will
implicitly create an entry for poolid causing register_new_pgs() to assume that
the newly created pgs in the new pool are in fact a result of a split
preventing MOSDPGCreate messages from being sent out.

Fixes: #4813
Backport: cuttlefish
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agomon: Paxos: get rid of the 'prepare_bootstrap()' mechanism 311/head
Joao Eduardo Luis [Wed, 22 May 2013 12:59:08 +0000 (13:59 +0100)]
mon: Paxos: get rid of the 'prepare_bootstrap()' mechanism

We don't need it after all.  If we are in the middle of some proposal,
then we guarantee that said proposal is likely to be retried.  If we
haven't yet proposed, then it's forever more likely that a client will
eventually retry the message that triggered this proposal.

Basically, this mechanism attempted at fixing a non-problem, and was in
fact triggering some unforeseen issues that would have required increasing
the code complexity for no good reason.

Fixes: #5102
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
12 years agomon: Paxos: finish queued proposals instead of clearing the list
Joao Eduardo Luis [Wed, 22 May 2013 12:51:13 +0000 (13:51 +0100)]
mon: Paxos: finish queued proposals instead of clearing the list

By finishing these Contexts, we make sure the Contexts they enclose (to be
called once the proposal goes through) will behave as their were initially
planned:  for instance, a C_Command() may retry the command if a -EAGAIN
is passed to 'finish_contexts', while a C_Trimmed() will simply set
'going_to_trim' to false.

This aims at fixing at least a bug in which Paxos will stop trimming if an
election is triggered while a trim is queued but not yet finished.  Such
happens because it is the C_Trimmed() context that is responsible for
resetting 'going_to_trim' back to false.  By clearing all the contexts on
the proposal list instead of finishing them, we stay forever unable to
trim Paxos again as 'going_to_trim' will stay True till the end of time as
we know it.

Fixes: #4895
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
12 years agomon: Paxos: finish_proposal() when we're finished recovering
Joao Eduardo Luis [Fri, 17 May 2013 17:23:36 +0000 (18:23 +0100)]
mon: Paxos: finish_proposal() when we're finished recovering

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
12 years agomon: implement --extract-monmap <filename>
Sage Weil [Tue, 21 May 2013 21:36:11 +0000 (14:36 -0700)]
mon: implement --extract-monmap <filename>

This will make for a simpler process for
  http://ceph.com/docs/master/rados/operations/add-or-rm-mons/#removing-monitors-from-an-unhealthy-cluster

Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit c0268e27497a4d8228ef54da9d4ca12f3ac1f1bf)

12 years agorgw: protect ops log socket formatter
Yehuda Sadeh [Fri, 3 May 2013 19:57:00 +0000 (12:57 -0700)]
rgw: protect ops log socket formatter

Fixes: #4905
Ops log (through the unix domain socket) uses a formatter, which wasn't
protected.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agoos/LevelDBStore: fix compression selection
Sage Weil [Tue, 21 May 2013 15:16:56 +0000 (08:16 -0700)]
os/LevelDBStore: fix compression selection

We were always disabling compression.

Fixes: #5131
Reported-by: Sylvain Munaut <s.munaut@whatever-company.com>
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agodebian: stop sysvinit on ceph.prerm
Sage Weil [Mon, 20 May 2013 20:34:27 +0000 (13:34 -0700)]
debian: stop sysvinit on ceph.prerm

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoceph df: fix si units for 'global' stats
Mike Kelly [Thu, 16 May 2013 16:29:50 +0000 (12:29 -0400)]
ceph df: fix si units for 'global' stats

si_t expects bytes, but it was being given kilobytes.

Signed-off-by: Mike Kelly <pioto@pioto.org>
(cherry picked from commit 0c2b738d8d07994fee4c73dd076ac9364a64bdb2)

12 years agoMerge pull request #295 from ceph/wip-5077
Sage Weil [Fri, 17 May 2013 16:26:25 +0000 (09:26 -0700)]
Merge pull request #295 from ceph/wip-5077

Reviewed-by: Joao Luis <joao.luis@inktank.com>
12 years agosysvinit: fix enumeration of local daemons when specifying type only
Sage Weil [Fri, 17 May 2013 03:37:05 +0000 (20:37 -0700)]
sysvinit: fix enumeration of local daemons when specifying type only

- prepend $local to the $allconf list at the top
- remove $local special case for all case
- fix the type prefix checks to explicitly check for prefixes

Fugly bash, but works!

Backport: cuttlefish, bobtail
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
12 years agoudev: install disk/by-partuuid rules
Sage Weil [Fri, 17 May 2013 01:40:29 +0000 (18:40 -0700)]
udev: install disk/by-partuuid rules

Wheezy's udev (175-7.2) has broken rules for the /dev/disk/by-partuuid/
symlinks that ceph-disk relies on.  Install parallel rules that work.  On
new udev, this is harmless; old older udev, this will make life better.

Fixes: #4865
Backport: cuttlefish
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon: clear pg delta after some period 295/head
Sage Weil [Fri, 17 May 2013 00:58:48 +0000 (17:58 -0700)]
mon: clear pg delta after some period

If we have not pg_map updates, the delta doesn't update, and can get stuck
with the velocity right before activity stopped.  This is confusing, and
can cause incorrect health warnings about in-progress recovery.

To fix this, zero the delta if there is no activity for
'mon delta reset interval' seconds.

Fixes: #5077
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agotest_filestore_idempotent_sequence: unmount prior to deleting store
Samuel Just [Thu, 16 May 2013 20:00:32 +0000 (13:00 -0700)]
test_filestore_idempotent_sequence: unmount prior to deleting store

FileStoreDiff umounts the stores in its destructor.

Also, DeterministicOpSequence handles deletes its passed
object store.

Fixes: #5076
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: David Zafman <david.zafman@inktank.com>
12 years agoRevert "test_filejournal.cc: cleanup memory in destructor"
Samuel Just [Thu, 16 May 2013 19:49:35 +0000 (12:49 -0700)]
Revert "test_filejournal.cc: cleanup memory in destructor"

The finish() method for Contexts calls delete this.

This reverts commit 36028916c4630ea66007760efed8fc6c441e7af5.

Fixes: #5075
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: David Zafman <david.zafman@inktank.com>
12 years agodebian: make radosgw require matching version of librados2
Sage Weil [Thu, 16 May 2013 20:17:45 +0000 (13:17 -0700)]
debian: make radosgw require matching version of librados2

...indirectly via ceph-common.  We get bad behavior when they diverge, I
think because of libcommon.la being linked both statically and dynamically.

Fixes: #4997
Backport: cuttlefish, bobtail
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Gary Lowell <gary.lowell@inktank.com>
12 years agoFileJournal: adjust write_pos prior to unlocking write_lock
Samuel Just [Tue, 14 May 2013 23:35:48 +0000 (16:35 -0700)]
FileJournal: adjust write_pos prior to unlocking write_lock

In committed_thru, we use write_pos to reset the header.start value in cases
where seq is past the end of our journalq.  It is therefore important that the
journalq be updated atomically with write_pos (that is, under the write_lock).

The call to align_bl() is moved into do_write in order to ensure that write_pos
is adjusted correctly prior to write_bl().

Also, we adjust pos at the end of write_bl() such that pos \in [get_top(),
header.max_size) after write_bl().

Fixes: #5020
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agomds: avoid assert after suicide()
Sage Weil [Thu, 16 May 2013 16:42:11 +0000 (09:42 -0700)]
mds: avoid assert after suicide()

Fixes: #5079
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMerge branch 'next'
Gary Lowell [Tue, 14 May 2013 22:38:24 +0000 (15:38 -0700)]
Merge branch 'next'

12 years agoMerge pull request #283 from dachary/wip-5058
athanatos [Tue, 14 May 2013 22:28:45 +0000 (15:28 -0700)]
Merge pull request #283 from dachary/wip-5058

internal documentation proofreading

Reviewed-by: Sam Just <sam.just@inktank.com>
12 years agodoc/rados/configuration: fix [mon] osd min down report* config docs
Sage Weil [Tue, 14 May 2013 21:02:27 +0000 (14:02 -0700)]
doc/rados/configuration: fix [mon] osd min down report* config docs

Fix other osd -> mon section name, and note the old config value name prior
to v0.62.

Fixes: #5044.
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoreflect recent changes in the pg deletion logic 283/head
Loic Dachary [Tue, 14 May 2013 13:29:03 +0000 (15:29 +0200)]
reflect recent changes in the pg deletion logic

No need to wait on DeletingStateRef for flush https://github.com/ceph/ceph/commit/d3dd99b725afaa026fe6f700ddc14a7f657f2170
Fix typos

http://tracker.ceph.com/issues/5058 refs #5058

Signed-off-by: Loic Dachary <loic@dachary.org>
12 years agofix typos and add hyperlink to peering
Loic Dachary [Tue, 14 May 2013 10:06:21 +0000 (12:06 +0200)]
fix typos and add hyperlink to peering

s/;/:/
s/up_acting_affected/acting_up_affected/
Add relative link to ../../peering

http://tracker.ceph.com/issues/5058 refs #5058

Signed-off-by: Loic Dachary <loic@dachary.org>
12 years agotypo s/come/some/
Loic Dachary [Tue, 14 May 2013 09:15:11 +0000 (11:15 +0200)]
typo s/come/some/

http://tracker.ceph.com/issues/5058 refs #5058

Signed-off-by: Loic Dachary <loic@dachary.org>
12 years agoupdate op added to a waiting queue or discarded
Loic Dachary [Tue, 14 May 2013 08:52:40 +0000 (10:52 +0200)]
update op added to a waiting queue or discarded

The decision to discard an op happens either in OSD or in PG.
The operation queue goes to a single OpWQ object if waiting_map does not impose a delay op_queue.
The decision to add an op to a waiting queue regardless of its type is updated.
The decision to add a CEPH_MSG_OSD_OP to a waiting queue is described in full.

http://tracker.ceph.com/issues/5058 refs #5058

Signed-off-by: Loic Dachary <loic@dachary.org>
12 years agomd/Sever.cc: fix straydn assert
Sage Weil [Tue, 14 May 2013 17:31:27 +0000 (10:31 -0700)]
md/Sever.cc: fix straydn assert

From fb222a0a1c98a4141b6d0e79eac7a41c208f7147, we only know straydn is
non-null if oldin is non-null.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMerge pull request #285 from dalgaaf/wip-da-CID-fixes-2-v3
Sage Weil [Tue, 14 May 2013 17:30:20 +0000 (10:30 -0700)]
Merge pull request #285 from dalgaaf/wip-da-CID-fixes-2-v3

Reviewed-by: Sage Weil <sage@inktank.com>
12 years agorgw/rgw_user.cc: fix possible NULL pointer dereference 285/head
Danny Al-Gaaf [Tue, 14 May 2013 17:20:29 +0000 (19:20 +0200)]
rgw/rgw_user.cc: fix possible NULL pointer dereference

CID 1019559 (#1 of 1): Dereference after null check (FORWARD_NULL)
  var_deref_model: Passing null pointer "usr" to function
  "RGWUser::get_store()", which dereferences it.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/Server.cc: fix possible NULL pointer dereference
Danny Al-Gaaf [Tue, 14 May 2013 17:15:23 +0000 (19:15 +0200)]
mds/Server.cc: fix possible NULL pointer dereference

Assert if straydn is NULL.

CID 1019554 (#2 of 2): Dereference after null check (FORWARD_NULL)
  var_deref_model: Passing null pointer "straydn" to function
  "MDSCacheObject::is_auth() const", which dereferences it.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/Server.cc: fix possible NULL pointer dereference
Danny Al-Gaaf [Tue, 14 May 2013 17:07:29 +0000 (19:07 +0200)]
mds/Server.cc: fix possible NULL pointer dereference

Assert of straydn is NULL here.

CID 1019558 (#1 of 1): Dereference after null check (FORWARD_NULL)
  var_deref_model: Passing null pointer "straydn" to function
  "CDentry::get_dir() const", which dereferences it.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/Server.cc: fix possible NULL pointer dereference
Danny Al-Gaaf [Tue, 14 May 2013 17:02:20 +0000 (19:02 +0200)]
mds/Server.cc: fix possible NULL pointer dereference

Assert if destdn == NULL.

CID 1019557 (#1 of 1): Dereference after null check (FORWARD_NULL)
  var_deref_model: Passing null pointer "destdn" to function
  "CDentry::get_dir() const", which dereferences it.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agolibrados/AioCompletionImpl.h: add missing Lock
Danny Al-Gaaf [Tue, 14 May 2013 16:50:09 +0000 (18:50 +0200)]
librados/AioCompletionImpl.h: add missing Lock

Add missing Lock around code changing AioCompletionImpl::rval/ack and safe
in C_AioCompleteAndSafe::finish().

CID 1019565 (#1 of 1): Data race condition (MISSING_LOCK)
  missing_lock: Accessing "this->c->rval" ("_ZN8librados17AioCompletionImplE.rval")
  requires the "Mutex._m" lock.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agosrc/dupstore.cc: check return value of list_collections()
Danny Al-Gaaf [Tue, 14 May 2013 15:02:56 +0000 (17:02 +0200)]
src/dupstore.cc: check return value of list_collections()

CID 1019545 (#1 of 1): Unchecked return value (CHECKED_RETURN)
  check_return: Calling function "ObjectStore::list_collections
  (std::vector<coll_t, std::allocator<coll_t> > &)" without
  checking return value (as is done elsewhere 5 out of 6 times).

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/Server.cc: fix possible NULL pointer dereference
Danny Al-Gaaf [Tue, 14 May 2013 14:50:57 +0000 (16:50 +0200)]
mds/Server.cc: fix possible NULL pointer dereference

CID 1019555 (#1 of 1): Dereference after null check (FORWARD_NULL)
  var_deref_model: Passing null pointer "in" to function
  "Server::_need_force_journal(CInode *, bool)", which dereferences it.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agosrc/rbd.cc: use 64-bits to shift 'order'
Danny Al-Gaaf [Mon, 13 May 2013 14:19:46 +0000 (16:19 +0200)]
src/rbd.cc: use 64-bits to shift 'order'

CID 1019568 (#1 of 1): Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
  overflow_before_widen: Potentially overflowing expression "1 << *order" with
  type "int" (32 bits, signed) is evaluated using 32-bit arithmetic before being
  used in a context which expects an expression of type "uint64_t" (64 bits,
  unsigned). To avoid overflow, cast the left operand to "uint64_t" before
  performing the left shift.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomon/Monitor.cc: init 'timecheck_acks' with '0' in constructor
Danny Al-Gaaf [Mon, 13 May 2013 14:02:04 +0000 (16:02 +0200)]
mon/Monitor.cc: init 'timecheck_acks' with '0' in constructor

CID 1019623 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
  uninit_member: Non-static class member "timecheck_acks" is not
  initialized in this constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomon/Monitor.h: init 'crc' in constructor with '0'
Danny Al-Gaaf [Mon, 13 May 2013 13:37:24 +0000 (15:37 +0200)]
mon/Monitor.h: init 'crc' in constructor with '0'

CID 1019624 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
  uninit_member: Non-static class member "crc" is not initialized
  in this constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomon/QuorumService.h: remove unused QuorumService::flags
Danny Al-Gaaf [Mon, 13 May 2013 12:52:38 +0000 (14:52 +0200)]
mon/QuorumService.h: remove unused QuorumService::flags

CID 1019626 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
  uninit_member: Non-static class member "flags" is not initialized
  in this constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agotest/test_cors.cc: initialize key_type in constructor
Danny Al-Gaaf [Mon, 13 May 2013 12:36:53 +0000 (14:36 +0200)]
test/test_cors.cc: initialize key_type in constructor

CID 1019635 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
  uninit_member: Non-static class member "kt" is not initialized in
  this constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agotools/ceph.cc: cleanup memory allocated for 'buf'
Danny Al-Gaaf [Mon, 13 May 2013 12:15:04 +0000 (14:15 +0200)]
tools/ceph.cc: cleanup memory allocated for 'buf'

CID 717123 (#1-2 of 2): Resource leak (RESOURCE_LEAK)
  leaked_storage: Variable "buf" going out of scope leaks the storage
  it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agotools/ceph.cc: close file descriptor in error case
Danny Al-Gaaf [Mon, 13 May 2013 12:04:08 +0000 (14:04 +0200)]
tools/ceph.cc: close file descriptor in error case

CID 717122 (#1 of 1): Resource leak (RESOURCE_LEAK)
  leaked_handle: Handle variable "fd" going out of scope leaks
  the handle.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agotools/ceph.cc: close file descriptor in error case
Danny Al-Gaaf [Mon, 13 May 2013 11:59:59 +0000 (13:59 +0200)]
tools/ceph.cc: close file descriptor in error case

CID 717121 (#1 of 1): Resource leak (RESOURCE_LEAK)
  leaked_handle: Handle variable "fd" going out of scope leaks the handle.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agotest_filejournal.cc: cleanup memory in destructor
Danny Al-Gaaf [Mon, 13 May 2013 11:52:32 +0000 (13:52 +0200)]
test_filejournal.cc: cleanup memory in destructor

CID 716885 (#1 of 1): Resource leak in object (CTOR_DTOR_LEAK)
  alloc_new: Allocating memory by calling "new C_SafeCond(&this->lock,
    &this->cond, &this->done, NULL)".
  ctor_dtor_leak: The constructor allocates field "c" of "C_Sync" but
    the destructor and whatever functions it calls do not free it.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agolibrbd/test_librbd.cc: free memory in test_list_children()
Danny Al-Gaaf [Mon, 13 May 2013 11:40:03 +0000 (13:40 +0200)]
librbd/test_librbd.cc: free memory in test_list_children()

CID 719581 (#7 of 7): Resource leak (RESOURCE_LEAK)
CID 719581 (#6 of 7): Resource leak (RESOURCE_LEAK)
  leaked_storage: Variable "pools" going out of scope leaks the
  storage it points to.
CID 719582 (#6-7 of 7): Resource leak (RESOURCE_LEAK)
  leaked_storage: Variable "children" going out of scope leaks
  the storage it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoscratchtool.c: cleanup rados_t on error
Danny Al-Gaaf [Mon, 13 May 2013 11:17:14 +0000 (13:17 +0200)]
scratchtool.c: cleanup rados_t on error

Make sure rados_shutdown() get called also in error case.

CID 717106 (#1 of 1): Resource leak (RESOURCE_LEAK)
  leaked_storage: Variable "cl" going out of scope leaks the
  storage it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agotest/kv_store_bench.cc: fix resource leak
Danny Al-Gaaf [Mon, 13 May 2013 11:03:18 +0000 (13:03 +0200)]
test/kv_store_bench.cc: fix resource leak

CID 727984 (#5 of 5): Resource leak (RESOURCE_LEAK)
  leaked_storage: Variable "cb_args" going out of scope leaks the storage
  it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agofilestore/test_idempotent_sequence.cc: fix FileStore leaks
Danny Al-Gaaf [Mon, 13 May 2013 10:45:03 +0000 (12:45 +0200)]
filestore/test_idempotent_sequence.cc: fix FileStore leaks

CID 717107 (#1 of 1): Resource leak (RESOURCE_LEAK)
  leaked_storage: Variable "store" going out of scope leaks the
  storage it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoceph-filestore-dump.cc: cleanup on error case
Danny Al-Gaaf [Mon, 13 May 2013 09:50:37 +0000 (11:50 +0200)]
ceph-filestore-dump.cc: cleanup on error case

CID 1019589 (#1 of 1): Resource leak (RESOURCE_LEAK)
  leaked_storage: Variable "t" going out of scope leaks the
  storage it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoceph-filestore-dump.cc: cleanup resource in error case
Danny Al-Gaaf [Mon, 13 May 2013 09:42:23 +0000 (11:42 +0200)]
ceph-filestore-dump.cc: cleanup resource in error case

CID 1019590 (#1 of 1): Resource leak (RESOURCE_LEAK):
 leaked_storage: Variable "rmt" going out of scope leaks the
 storage it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agov0.62 v0.62
Gary Lowell [Tue, 14 May 2013 16:13:07 +0000 (09:13 -0700)]
v0.62

12 years agodoc/release-notes: v0.61.2
Sage Weil [Tue, 14 May 2013 03:48:20 +0000 (20:48 -0700)]
doc/release-notes: v0.61.2

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMerge remote-tracking branch 'gh/next'
Sage Weil [Tue, 14 May 2013 00:17:43 +0000 (17:17 -0700)]
Merge remote-tracking branch 'gh/next'

12 years agoMerge pull request #281 from ceph/wip-rbd-rm-enoent
Sage Weil [Mon, 13 May 2013 23:07:55 +0000 (16:07 -0700)]
Merge pull request #281 from ceph/wip-rbd-rm-enoent

Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoPG: fix some brace styling
Samuel Just [Mon, 13 May 2013 22:44:17 +0000 (15:44 -0700)]
PG: fix some brace styling

Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: David Zafman <david.zafman@inktank.com>
12 years agoPG: subset_last_update must be at least log.tail
Samuel Just [Mon, 13 May 2013 21:23:00 +0000 (14:23 -0700)]
PG: subset_last_update must be at least log.tail

Fixes: 5020
Backport: bobtail, cuttlefish
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: David Zafman <david.zafman@inktank.com>
12 years agoSimpleThrottle: fix -ENOENT checking 281/head
Josh Durgin [Mon, 13 May 2013 21:49:42 +0000 (14:49 -0700)]
SimpleThrottle: fix -ENOENT checking

The condition was reversed. Rewrite it so it's clear that we're
ignoring -ENOENT only when m_ignore_enoent is set.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agoReplace mis-named mon config variables using mon_osd_min_down_reports/mon_osd_min_dow...
David Zafman [Mon, 13 May 2013 19:53:11 +0000 (12:53 -0700)]
Replace mis-named mon config variables using mon_osd_min_down_reports/mon_osd_min_down_reporters

Signed-off-by: David Zafman <david.zafman@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoMerge pull request #280 from ceph/wip-4996
Sage Weil [Mon, 13 May 2013 19:31:31 +0000 (12:31 -0700)]
Merge pull request #280 from ceph/wip-4996

Reviewed-by: Joao Luis <joao.luis@inktank.com>
12 years agomon: fix validatation of mds ids in mon commands 280/head
Sage Weil [Sat, 11 May 2013 05:14:05 +0000 (22:14 -0700)]
mon: fix validatation of mds ids in mon commands

Fixes: #4996
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMerge pull request #278 from ceph/wip-4974
Sage Weil [Mon, 13 May 2013 18:39:36 +0000 (11:39 -0700)]
Merge pull request #278 from ceph/wip-4974

Reviewed-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agomon: Monitor: tolerate GV duplicates during conversion 278/head
Joao Eduardo Luis [Mon, 13 May 2013 14:36:59 +0000 (15:36 +0100)]
mon: Monitor: tolerate GV duplicates during conversion

Fixes: #4974
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
12 years agoceph_test_libcephfs: fix xattr test
Sage Weil [Mon, 13 May 2013 17:12:44 +0000 (10:12 -0700)]
ceph_test_libcephfs: fix xattr test

This broke in 0c70e44630734760fd36e0c770a33fb0e74b42a4.

Fixes: #5030
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoOSD: We need to wait on CLEARING_DIR, not DELETED_DIR
Samuel Just [Mon, 13 May 2013 16:50:14 +0000 (09:50 -0700)]
OSD: We need to wait on CLEARING_DIR, not DELETED_DIR

Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoMerge pull request #274 from dalgaaf/wip-da-fix-osd_h
athanatos [Mon, 13 May 2013 16:42:26 +0000 (09:42 -0700)]
Merge pull request #274 from dalgaaf/wip-da-fix-osd_h

osd/OSD.h: fix try_stop_deletion

Reviewed-by: Sam Just <sam.just@inktank.com>
12 years agoMerge pull request #275 from ceph/wip-rbd-read-from-replica
Josh Durgin [Mon, 13 May 2013 06:01:14 +0000 (23:01 -0700)]
Merge pull request #275 from ceph/wip-rbd-read-from-replica

Reviewed-by: Sage Weil <sage.weil@inktank.com>
12 years agolibrbd: add options to enable balanced or localized reads for snapshots 275/head
Josh Durgin [Sun, 12 May 2013 21:53:26 +0000 (14:53 -0700)]
librbd: add options to enable balanced or localized reads for snapshots

Since snapshots never change, it's safe to read from replicas for them.
A common use for this would be reading from a parent snapshot shared by
many clones.

Convert LibrbdWriteback and AioRead to use the ObjectOperation api
so we can set flags. Fortunately the external wrapper holds no data,
so its lifecycle doesn't need to be managed.

Include a simple workunit that sets the flags in various combinations
and looks for their presence in the logs from 'rbd export'.

Fixes: #3064
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agoReplicatedPG: send -EAGAIN for both balanced and localized reads
Josh Durgin [Sun, 12 May 2013 21:47:20 +0000 (14:47 -0700)]
ReplicatedPG: send -EAGAIN for both balanced and localized reads

This logic for localized reads applies to balanced reads too.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agolibrados: add per-ObjectOperation flags for balanced and localized reads
Josh Durgin [Sun, 12 May 2013 21:45:36 +0000 (14:45 -0700)]
librados: add per-ObjectOperation flags for balanced and localized reads

These need to apply to the entire ObjectOperation, not just a subop,
so use a new enum and a new aio_operate() call that takes them.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>