Fixes: #8169
Backport: firefly
We didn't calculate the user manifest's object etag at all. The etag
needs to be the md5 of the contantenation of all the parts' etags.
Danny Al-Gaaf [Thu, 8 May 2014 14:09:07 +0000 (16:09 +0200)]
rbd.cc: init 'snap_protected' to fix -Wconditional-uninitialized
Init 'snap_protected' with false to fix:
rbd.cc:544:35: warning: variable 'snap_protected' may be uninitialized
when used here [-Wconditional-uninitialized]
f->dump_string("protected", snap_protected ? "true" : "false");
^~~~~~~~~~~~~~
rbd.cc:482:22: note: initialize the variable 'snap_protected' to silence
this warning
bool snap_protected;
^
= false
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Thu, 8 May 2014 14:04:18 +0000 (16:04 +0200)]
rbd-fuse.c: init 'rbd' in open_rbd_image()
Init 'rbd' in open_rbd_image() with NULL and add a check for
'rbd' before dereference it to fix:
rbd_fuse/rbd-fuse.c:182:29: warning: variable 'rbd' may be uninitialized
when used here [-Wconditional-uninitialized]
int ret = rbd_open(ioctx, rbd->image_name, &(rbd->image), NULL);
^~~
rbd_fuse/rbd-fuse.c:151:27: note: initialize the variable 'rbd' to silence
this warning
struct rbd_openimage *rbd;
^
= NULL
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Thu, 8 May 2014 13:54:24 +0000 (15:54 +0200)]
ObjectCacher::_wait_for_write(): init 'bool done'
Init 'bool done' with 'false' to fix:
osdc/Objecter.h:915:27: warning: implicit conversion los: variable 'done'
may be uninitialized when used here [-Wconditional-uninitialized]
while (!done)
^~~~
osdc/ObjectCacher.cc:1399:14: note: initialize the variable 'done' to
silence this warning
bool done;
^
= false
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Thu, 8 May 2014 13:47:08 +0000 (15:47 +0200)]
Objecter::calc_target(): init best_locality with 0
Init best_locality to fix:
osdc/Objecter.cc:1519:26: warning: variable 'best_locality' may be
uninitialized when used here [-Wconditional-uninitialized]
(locality >= 0 && best_locality >= 0 &&
^~~~~~~~~~~~~
osdc/Objecter.cc:1511:19: note: initialize the variable 'best_locality'
to silence this warning
int best_locality;
^
= 0
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
John Spray [Tue, 6 May 2014 15:49:53 +0000 (08:49 -0700)]
encoding: make .size() to __u32 cast explicit
Caught by clang warning that this is a conversion
from "unsigned long" to "unsigned int" which can
lose precision. However, this is the conversion
we want because our serialization format defines
sizes as 4 bytes.
Signed-off-by: John Spray <john.spray@inktank.com>
Yan, Zheng [Mon, 5 May 2014 08:23:14 +0000 (16:23 +0800)]
mds: properly wake up dentry waiters after fragmenting dirfrag
When active MDS wants to fragment a replica dirfrag, it should set
the 'replay' parameter of MDCache::adjust_dir_fragments() to false.
It makes sure that CDir::merge/split wake up any dentry waiter.
Danny Al-Gaaf [Wed, 7 May 2014 15:28:31 +0000 (17:28 +0200)]
test_rgw_manifest.cc: fix VLA of non-POD element type
Use vector to fix:
test/rgw/test_rgw_manifest.cc:184:20: error: variable length array
of non-POD element type 'RGWObjManifest'
RGWObjManifest pm[num_parts];
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Ilya Dryomov [Fri, 2 May 2014 11:13:11 +0000 (15:13 +0400)]
test_librbd_fsx: fix a bug in docloseopen()
docloseopen() always opens $iname image. This is bad, because the
image we had opened could have been something like $iname-clone3. Fix
it by leveraging the fact that rbd_ctx has an image name field.
Ilya Dryomov [Fri, 2 May 2014 11:13:11 +0000 (15:13 +0400)]
test_librbd_fsx: add krbd mode support
Add krbd mode support (-K) to test krbd in the same way librbd is
tested. This introduces a dependency on libkrbd and, because it's
a C++ static library, requires C++ linking. The rbd_operations
framework can be extended in the future to also test rbd_fuse.
Ilya Dryomov [Thu, 1 May 2014 12:08:03 +0000 (16:08 +0400)]
test_librbd_fsx: add a flag to disable randomized striping
In preparation for krbd mode support, introduce an option to disable
randomized striping. The kernel as of 3.15 does not support "fancy"
striping and will not map images with non-default striping values.
Ilya Dryomov [Thu, 1 May 2014 12:08:03 +0000 (16:08 +0400)]
test_librbd_fsx: add holebdy option
In preparation for krbd mode support, provide an option to specify
alignment for discards. The kernel will reject discard requests whose
offset and length are not sector-size aligned.
Ilya Dryomov [Thu, 1 May 2014 12:08:03 +0000 (16:08 +0400)]
test_librbd_fsx: make resizes sector-size aligned
In preparation for krbd mode support, change check_trunc_hack() to
resize to a sector-size aligned value. The kernel will not work with
images whose size is not sector-size aligned.
test_librbd_fsx: use posix_memalign() to allocate aligned buffers
Use posix_memalign() to allocate good_buf and temp_buf, which must be
writebdy and readbdy aligned respectively. Using round_ptr_up() the
way it is used makes fsx crash on free()s at the end of main(), because
the pointer returned by malloc() is overwritten by the aligned pointer.
Gregory Farnum [Wed, 7 May 2014 06:06:14 +0000 (23:06 -0700)]
Merge pull request #1532 from ceph/wip-fast-dispatch
fast dispatch
This series adds an ms_fast_dispatch interface to the Messenger/Dispatcher, designed so that you can dispatch messages directly from the Pipe threads without going through the Dispatch queue.
It also sets the OSD to make use of this interface for most operations, and switches to finer-grained locking and use of local data in a bunch of different paths to enable that.
Yehuda Sadeh [Tue, 6 May 2014 23:55:27 +0000 (16:55 -0700)]
rgw: fix stripe_size calculation
Fixes: #8299
Backport: firefly
The stripe size calculation was broken, specifically affected cases
where we had manifest that described multiple parts.
Yan, Zheng [Sun, 4 May 2014 02:15:36 +0000 (10:15 +0800)]
mds: allow negetive rstat
When splitting dirfrag, delta rstat is always added to the first new
dirfrag. Ancestors of the dirfrag may have nagtive rstat before the
delta rstat has been propagated to them. For example:
inode 100 n(v1 b-4096)
|- dir 100 n(v1 b-4096)
|- dentry
|- inode 101 n(v1 b-4096)
|- dir 101.0* n(v1)/n(v1 b-4096)
|- dir 101.1* n(v1)
mds: fix frozen inode check in MDCache::handle_discover()
When MDCache::handle_discover() encounters a frozen dirfrag, it should
proceed if the dirfrag is being merged, but the MDS hasn't frozen all
dirfrags yet. When MDCache::handle_discover() checks if a inode is
frozen, it should use CInode::is_frozen_inode() (which doesn't check if
inode's parent dirfrag is frozen).
mds: include authpinned objects in remote authpin request
Server::handle_slave_auth_pin() may drop old authpins if it encounters
object that is not authpinable. So it is better to include objects that
have already been authpinned in the remote authpin reuqest.