Danny Al-Gaaf [Fri, 1 Mar 2013 19:12:03 +0000 (20:12 +0100)]
mds/Locker.cc: fix warning about 'Possible null pointer dereference'
Fix following warning from cppcheck:
[src/mds/Locker.cc:2255] -> [src/mds/Locker.cc:2258]: (error)
Possible null pointer dereference: in - otherwise it is redundant
to check it against null.
Since head_in used for call pick_inode_snap() is already valid,
there is no need to check if 'CInode *in' is not NULL. Remove
not needed check.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Dan Mick [Fri, 8 Mar 2013 23:18:54 +0000 (15:18 -0800)]
ceph_common.sh: add warning if 'host' contains dots
This is a common error and there's no reason the script can't
at least tell you it's a really bad idea. One might argue it
could even successfully proactively truncate the host parameter
at the first dot, but that's a little controlling, perhaps.
Signed-off-by: Dan Mick <dan.mick@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Sage Weil [Fri, 8 Mar 2013 16:56:44 +0000 (08:56 -0800)]
osd: mark down connections from old peers
Close out any connection with an old peer. This avoids a race like:
- peer marked down
- we get map, mark down the con
- they reconnect and try to send us some stuff
- we share our map to tell them they are old and dead, but leave the con
open
...
- peer marks itself up a few times, eventually reuses the same port
- sends messages on their fresh con
- we discard because of our old con
This could cause a tight reconnect loop, but it is better than wrong
behavior.
Other possible fixes:
- make addr nonce truly unique (augment pid in nonce)
- make a smarter 'disposable' msgr state (bleh)
Jan Harkes [Thu, 7 Mar 2013 21:07:26 +0000 (16:07 -0500)]
Properly format Content-Length: header on 32-bit systems.
- Promote len argument in dump_content_length to uint64_t.
- Make sure there is sufficient scratch space to format string.
- Use PRIu64 macro for formatting.
Yehuda Sadeh [Thu, 7 Mar 2013 03:32:21 +0000 (19:32 -0800)]
rgw: don't iterate through all objects when in namespace
Fixes: #4363
Backport: argonaut, bobtail
When listing objects in namespace don't iterate through all the
objects, only go though the ones that starts with the namespace
prefix
Jan Harkes [Fri, 8 Mar 2013 03:10:42 +0000 (22:10 -0500)]
Avoid sending a success response when an error occurs.
Functions called from RGWGetObj_ObjStore_S3::send_response_data may
change the value of the non-local variable 'ret'. But the response
relies on a local 'req_state' which copies ret at the start of the
function.
Right now none of the called functions actually changes ret so the
problem doesn't trigger, but to avoid future breakage it is safer
to not rely on the (early) copy of the ret variable.
Sage Weil [Wed, 6 Mar 2013 03:12:21 +0000 (19:12 -0800)]
mds: pass created_ino back to client on replayed requests
After an MDS restart, the client will resend uncommitted requests. Use the
information we now have in the session_info_t to pass the created ino
back via the extra_bl payload in the reply.
Fixes: #4034 Signed-off-by: Sage Weil <sage@inktank.com>
Sage Weil [Fri, 8 Mar 2013 00:33:12 +0000 (16:33 -0800)]
mds: track created inos with completed request ids in session info
Along with each session completed request (tid), also track the created
ino (if any). This will be used to pass back to the client when they
replay requests in the next patch.
Do not bother making this a backward compatible encoding. The only
benefit is to allow ceph-mds code to run and then old mds code to run
after it. Given all of the other incompat changes we *just* made, this
is highly unlikely and not worth the code clutter. If we had spanned
more releases or a stable release the story would be different.
While we are here, inline the second add_completed_request() method variant
since there is only a single caller and having it overloaded somewhat
obscures what is going on. This also avoids a duplicate lookup in the
session map in the have_session() check and then in the (old) helper.
Sage Weil [Sat, 2 Mar 2013 00:28:25 +0000 (16:28 -0800)]
mds: do not do traceless reply for open O_TRUNC requests
Even though these are "may_write" and may be a mutation, the MDS should not
fake out a traceless reply. In a real failure, it looks like:
- mds process request (mutation)
- mds fails
- client resends request
- mds notes that it is O_TRUNC, and already committed, and proceeds with
a regular open
And that is all fine.
But, that means that if we are trying to simulate this behavior without a
failure, then we should never do a traceless reply on an O_TRUNC request,
because the client will never see such a reply--it'll get a full open
request response instead.
Sage Weil [Fri, 1 Mar 2013 06:32:30 +0000 (22:32 -0800)]
client: clear I_COMPLETE on traceless reply for dentry request
If a request is against a dentry, and we get a traceless reply, clear
the directory I_COMPLETE flag on the parent directory because we can no
longer trust that our cache is complete.
It is possible we could do something a bit more intelligent here, but it
is not trivial because of racing requests, and traceless replies are
rare, so it's not worth the effort.
Sage Weil [Fri, 1 Mar 2013 02:07:33 +0000 (18:07 -0800)]
client: handle traceless replies from make_request()
Modify the generic make_request wrapper to retry lookups or getattrs on
requests when the ptarget pointer is specified but there is no trace in
the reply.
Refactor the _create() method to use this, effectively moving all of the
extra_bl code processing into make_request where it is generically
useful.
Josh Durgin [Thu, 7 Mar 2013 01:42:03 +0000 (17:42 -0800)]
common: reduce default in-memory logs for non-daemons
The default of 100000 can result in hundreds of MBs of extra memory
used. This was most obvious when using librbd with caching enabled,
since there was a dout(0) accidentally left in the ObjectCacher.
Noah Watkins [Wed, 6 Mar 2013 02:00:26 +0000 (18:00 -0800)]
libcephfs: return osd location from crush map
Adds ceph_get_osd_crush_location that returns a list of (type,name)
pairs for devices that exist between a given osd and the root of the
bucket hierarchy.
David Zafman [Fri, 22 Feb 2013 23:15:06 +0000 (15:15 -0800)]
osd/librados: add op to list clones/snaps for an object
Returning snap_set_t with clone info
and snapshots in ascending order
Add clones with snapshots to obj_list_snap_response_t
New rados_types.hpp with snap_set_t/clone_info_t
Move snap_t to rados_types.hpp
Add generate_test_instances() and TYPE() to encoding/types.h
Feature: #4207
Signed-off-by: David Zafman <david.zafman@inktank.com>
Add X-Python-Version >=2.6 to debian control file.
python-ceph complains when installed to debian squeeze about the 'with'
statement. Apparently installation tries to install the python-ceph package for
python 2.5, which does not support the 'with' statement natively.
Adam Manzanares [Fri, 1 Mar 2013 23:49:26 +0000 (15:49 -0800)]
librados.hpp: replace paris with pairs
Signed-off-by: Adam Manzanares <nmtadam@gmail.com>
Working on a lua-rados library I noticed that paris was used
in the place of pairs in some comments.