Sage Weil [Thu, 4 Dec 2014 23:53:26 +0000 (15:53 -0800)]
mon/OSDMonitor: do not reencode OSDMap on 'osd getmap'
Return the bits unmolested.
This is a slight change in that we do not reencode based on the client's
features. However, this is an admin command and the client is generally
the CLI or REST API. It makes more sense to provide the unmolested
bits than to reencode them based on features present in a tool that
never inspects the map.
Sage Weil [Sat, 16 Aug 2014 01:00:47 +0000 (18:00 -0700)]
add MMonGetOSDMap message
This message lets you explicitly request a range of full or incremental
maps from someone (the monitor, presumably), independent of any other
session state.
Sage Weil [Fri, 22 Aug 2014 18:52:26 +0000 (11:52 -0700)]
prevent random people from encoding the OSDMap
This is a safety check: nobody should be encoding OSDMaps except:
- the mons
- MOSDMap, when encoding old OSDMaps with legacy encodings
- ceph-dencoder
- the OSD
More importantly, nobody should be encoding OSDMap::Incremental except
- the leader mon
We use a reserved feature bit to indicate that the encoder is enlightened.
Note that we skip this check for legacy encodings, so we don't touch
MOSDMap in this patch.
Sage Weil [Sat, 16 Aug 2014 00:36:14 +0000 (17:36 -0700)]
osd: warn if reencoding and OSDMap with fewer features than the mon
It is very dangerous to reencode and OSDMap with fewer features than the
mon intended as we may be introducing a different variation of the same
OSDMap epoch into the wild. Add a build warning here as well as this is
a potentially serious problem.
John Spray [Thu, 6 Nov 2014 11:46:29 +0000 (11:46 +0000)]
osdc: fix Journaler write error handling
Since we started wrapping the write error
handler in a finisher, multiple calls to
handle_write_error would hit the assert()
on the second call before the actual
handler had been called (at the other end
of the finisher) from the first call.
The symptom was that the MDS was intermittently
failing to respawn on blacklist, seen in #10011.
Vicente Cheng [Wed, 29 Oct 2014 04:21:11 +0000 (12:21 +0800)]
rbd: Fix the rbd export when image size more than 2G
When using export <image-name> <path> and the size of image is more
than 2G, the previous version about finish() could not handle in
seeking the offset in image and return error.
This is caused by the incorrect variable type. Try to use the correct
variable type to fixed it.
I use another variable which type is uint64_t for confirming seeking
and still use the previous r for return error.
uint64_t is more better than type int for handle lseek64().
For testing injectargs a configuration option was changed that has side
effects on the cluster. It could introduce random failures later. It is
replaced with a configuration option that cannot have adverse side
effects on the cluster.
John Spray [Mon, 27 Oct 2014 12:02:17 +0000 (12:02 +0000)]
client: allow xattr caps in inject_release_failure
Because some test environments generate spurious
rmxattr operations, allow the client to release
'X' caps. Allows xattr operations to proceed
while still preventing client releasing other caps.
Fixes: #9800 Signed-off-by: John Spray <john.spray@redhat.com>
huangjun [Tue, 28 Oct 2014 07:05:37 +0000 (15:05 +0800)]
Fix the match error when starting OSD daemons.
If we have osd.7 and osd.77 on the same host, osd.7 will not be mounted if
osd.77 is mounted. Signed-off-by: huangjun <hjwsm1989@gmail.com>
Greg Farnum [Thu, 23 Oct 2014 00:16:31 +0000 (17:16 -0700)]
client: cast m->get_client_tid() to compare to 16-bit Inode::flushing_cap_tid
m->get_client_tid() is 64 bits (as it should be), but Inode::flushing_cap_tid
is only 16 bits. 16 bits should be plenty to let the cap flush updates
pipeline appropriately, but we need to cast in the proper direction when
comparing these differently-sized versions. So downcast the 64-bit one
to 16 bits.
Fix indentation to the same as the original fsx.c .
Fix for Coverity issue:
CID 1219473 (#1-2 of 2): Nesting level does not match indentation
(NESTING_INDENT_MISMATCH)
uncle: This statement is indented to column 25, as if it were
nested within the preceding parent statement, but it is not.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix memory leak caused by using std::string to hold result
of strdup call returned from getObjName().
Fix for Coverity issues:
CID 1221525 (#1 of 1): Resource leak (RESOURCE_LEAK)
leaked_storage: Failing to save or free storage allocated by
this->getObjName(soid, 0UL) leaks it.
CID 1221526 (1-3 of 3): Resource leak (RESOURCE_LEAK)
leaked_storage: Failing to save or free storage allocated by
this->getObjName(soid, *) leaks it.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Mon, 27 Oct 2014 10:09:01 +0000 (11:09 +0100)]
rgw/rgw_formats.cc: fix realloc memory leak
Fix handling of realloc. If realloc() fails it returns NULL, assigning
the return value of realloc() directly to the pointer without checking
for the result will lead to a memory leak in error case.
Use a temporary pointer to hold the result of realloc(). In error case
print error and exit, otherwise assign it to the pointer we want to realloc.
Fix also error checks for malloc to fail as soon as malloc fails and
don't try to run realloc again after failed malloc.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Sun, 26 Oct 2014 19:56:25 +0000 (20:56 +0100)]
arch/neon.c: check result of fread()
Fix for:
CID 1128384 (#1 of 1): Ignoring number of bytes read (CHECKED_RETURN)
check_return: fread(void * restrict, size_t, size_t, FILE * restrict)
returns the number of bytes read, but it is ignored.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 1054853 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking is_truncated suggests that it may
be null, but it has already been dereferenced on all paths leading
to the check.
Add vim line to file.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Sun, 26 Oct 2014 17:19:58 +0000 (18:19 +0100)]
SyntheticClient.cc: check return value of getdir()
Check return value as done in all other places. Fix error messages
to print correct function name getdir and not read_dir/readdir since
the error isn't necessarily raised by read_dir().
Fix for:
CID 1219463 (#1 of 1): Unchecked return value (CHECKED_RETURN)
check_return: Calling getdir without checking return value (as
is done elsewhere 4 out of 5 times).
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>