Yan, Zheng [Wed, 14 May 2014 06:32:34 +0000 (14:32 +0800)]
mds: fix remote auth pin race
When removing auth unpinned objects from mdr->remote_auth_pins,
Server::handle_slave_auth_pin() checks object's authority to decide
if the object was auth pinned by a given MDS. This method isn't
reliable because when object isn't auth pinned, its authority may
change.
The fix is remember from which MDS an objects was auth pinned.
Yan, Zheng [Thu, 8 May 2014 07:14:43 +0000 (15:14 +0800)]
mds: skip journaling slave rename when possible
Rename operation can affect three dentries and two inodes. For MDS
who receives rename slave request, but isn't authority of any of
these dentries/inodes and doesn't have any auth subtree under these
dentries/inodes, journaling slave rename can be skipped.
Yan, Zheng [Thu, 8 May 2014 05:55:25 +0000 (13:55 +0800)]
mds: include all of directory inode's replicas in rmdir witnesses
If a MDS crashed after journaling a rmdir operation, but before sending
MDentryUnlink messages. Survivor MDS may have incorrect linkage for the
removed directory. Later when the MDS recovers, the incorrect linkage
can cause survivor MDS crash.
The fix is include all of directory inode's replicas in rmdir witnesses
list. When receiving a rmdir slave request, MDS who has no auth subtree
in the directory only need to update its cache and send reply (doesn't
need to journal the slave request).
Ilya Dryomov [Fri, 16 May 2014 15:03:13 +0000 (19:03 +0400)]
OSDMonitor: set next commit in mon primary-affinity reply
Commit 8c5c55c8b47e ("mon: set next commit in mon command replies")
fixed MMonCommand replies to include the right version, but the
primary-affinity handler was authored before that. Fix it.
Dmitry Smirnov [Fri, 16 May 2014 10:26:38 +0000 (20:26 +1000)]
sample.ceph.conf: minor update
* Moved filestore settings above [osd.*] declarations otherwise
(if uncommented) those settings might be applied only to last
OSD which is not very obvious.
* Few options added.
John Spray [Tue, 13 May 2014 16:32:03 +0000 (17:32 +0100)]
doc: update instructions for RPM distros
Fix RPM building instructions: this has been broken since
libs3 was included inline in the ceph repo as a submodule.
"rpmbuild -tb" was concatenating the ceph.spec and
libs3.spec files, resulting in something that didn't work.
Also, the instructions suggested downloading a .tar.gz file
whereas the specfile requires a .tar.bz2 file.
Also, add a convenient yum command line for getting the compile
dependencies on Fedora 20.
Signed-off-by: John Spray <john.spray@inktank.com>
Dmitry Smirnov [Mon, 12 May 2014 04:08:44 +0000 (14:08 +1000)]
prioritise use of `javac` executable (gcj provides it through alternatives).
On Debian this fixes FTBFS when gcj-jdk and openjdk-7-jdk are installed at
the same time because build system will use default `javac` executable
provided by current JDK through `update-alternatives` instead of blindly
calling GCJ when it is present.
Revert commit 40d56a97 (mds: optimize EMetaBlob::fullbit, remotebit,
nullbit encoding). This optimization creates small segments in the
result bufferlist of encoding EMetaBlob. Perf shows lots of CPU time
are used for allocating list node for bufferlist.
Yan, Zheng [Mon, 12 May 2014 02:24:51 +0000 (10:24 +0800)]
mds: properly clear new flag for stale client cap
CInode::encode_inodestat() should clear the 'new' flag of client
cap even when session is stale, because the 'new' flag prevents
Locker::issue_caps() from sending cap message to client.
Danny Al-Gaaf [Mon, 12 May 2014 00:33:44 +0000 (02:33 +0200)]
BtrfsFileStoreBackend.cc: fix ::unlinkat() result handling
Don't check for 'fd' but for the return value of the ::unlinkat() call.
Fix for:
[src/os/BtrfsFileStoreBackend.cc:72] -> [src/os/BtrfsFileStoreBackend.cc:74]:
(warning) Opposite conditions in nested 'if' blocks lead to a dead code block.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Mon, 12 May 2014 00:01:10 +0000 (02:01 +0200)]
rgw_user.cc: cleanup RGWAccessKeyPool::check_op()
Remove dead assignment and unsued variable 'secret_key'. Check
op_state.get_access_key() directly for emptiness without extra
variable. Fix comment above check for access key.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Sun, 11 May 2014 23:26:56 +0000 (01:26 +0200)]
MDBalancer.cc: remove some since 2009 unused code
Remove some since long time unused code and variables (commented out
since 2009).
Fix for:
[src/mds/MDBalancer.cc:757]: (style) Variable 'total_sent' is
assigned a value that is never used.
[src/mds/MDBalancer.cc:665]: (style) Variable 'total_goal' is
assigned a value that is never used.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Sun, 11 May 2014 22:05:15 +0000 (00:05 +0200)]
test_cls_rbd.cc: use 'delete []' if 'new char[len]' was used
Fix for:
[src/test/cls_rbd/test_cls_rbd.cc:82]: (error) Mismatching allocation
and deallocation: b
[src/test/cls_rbd/test_cls_rbd.cc:95]: (error) Mismatching allocation
and deallocation: b
[src/test/cls_rbd/test_cls_rbd.cc:97]: (error) Mismatching allocation
and deallocation: b
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Sun, 11 May 2014 21:13:00 +0000 (23:13 +0200)]
test/ObjectMap/KeyValueDBMemory.cc: use empty() instead of size()
Use empty() instead of 'size() == 0' to fix:
[src/test/ObjectMap/KeyValueDBMemory.cc:83]: (performance)
Possible inefficient checking for 'db' emptiness.
[src/test/ObjectMap/KeyValueDBMemory.cc:97]: (performance)
Possible inefficient checking for 'db' emptiness.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Sun, 11 May 2014 09:52:04 +0000 (11:52 +0200)]
cls_kvs.cc: remove dead assignment
Fix for:
[src/key_value_store/cls_kvs.cc:383] -> [src/key_value_store/cls_kvs.cc:386]:
(performance) Variable 'r' is reassigned a value before the old one has been used.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Sun, 11 May 2014 09:28:26 +0000 (11:28 +0200)]
rgw_user.cc:
Remove bool variable 'same_email' compare emails directly in
if check.
Fix for:
[src/rgw/rgw_user.cc:1926] -> [src/rgw/rgw_user.cc:1927]: (performance)
Variable 'same_email' is reassigned a value before the old one has been used.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Sat, 10 May 2014 22:36:20 +0000 (00:36 +0200)]
libcephfs.cc: fix possible NULL pointer deref
Fix possible NULL pointer dereference of 'inode' in ceph_ll_lookup_inode().
It's not enough to check for 'inode' without assert or error handling before
assert for '*inode != NULL' since this doesn't handle the 'inode == NULL'
case for the later calls.
Fix for:
1192 r = (cmount->get_client())->lookup_parent(*inode, &parent);
5 Dereference of null pointer (loaded from variable 'inode')
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Sat, 10 May 2014 17:06:32 +0000 (19:06 +0200)]
mds/Server.cc: remove unused initialization of 'destdnl'
Remove initialization of 'destdnl' since the assigned value was
never used and the same call is used some lines later again before
first usage. Fix for:
6579 CDentry::linkage_t *destdnl = destdn->get_linkage();
Value stored to 'destdnl' during its initialization is never read
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Sage Weil [Thu, 8 May 2014 17:42:42 +0000 (10:42 -0700)]
mon/OSDMonitor: force op resend when pool overlay changes
If a client is sending a sequence of ops (say, a, b, c, d) and partway
through that sequence it receives an OSDMap update that changes the
overlay, the ops will get send to different pools, and the replies will
come back completely out of order.
To fix this, force a resend of all outstanding ops any time the overlay
changes.
Fixes: #8305 Signed-off-by: Sage Weil <sage@inktank.com>
Sage Weil [Thu, 8 May 2014 17:52:11 +0000 (10:52 -0700)]
osdc/Objecter: resend ops in the last_force_op_resend epoch
If we are a client, and process a map that sets last_force_op_resend to
the current epoch, force a resend of this op.
If the OSD expects us to do this, it will discard our previous op. If the
OSD is old, it will process the old one, this will appear as a dup, and we
are no worse off than before.