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.
Signed-off-by: John Spray <john.spray@redhat.com>
Previously worked for journals starting from an
object boundary (i.e. freshly created filesystems)
Fixes: #9977
Signed-off-by: John Spray <john.spray@redhat.com>
Shutdown the delayed delivery before the incoming queue in case the
DelayedDelivery thread is busy queuing messages.
Fixes: #9910
Signed-off-by: Sage Weil <sage@redhat.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
Not sure how 'quick' this really is now compared with
the full filesystem instructions, but let's not leave
it incomplete.
Signed-off-by: John Spray <john.spray@redhat.com>
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().
Signed-off-by: Vicente Cheng <freeze.bilsted@gmail.com>
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.
http://tracker.ceph.com/issues/9919Fixes: #9919
Signed-off-by: Loic Dachary <loic-201408@dachary.org>
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>
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.
Fixes: #9869
Backport: giant, firefly, dumpling
Signed-off-by: Greg Farnum <greg@inktank.com>
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>
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>
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>
Fix for:
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>
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>
Fix for:
[src/test/test_rbd_replay.cc:193]: (portability) Passing NULL after the
last typed argument to a variadic function leads to undefined behaviour.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
The convert() call is changing data. To prevent Heisenbugs
depending in NDEBUG definition (e.g. if debug is off).
Move convert() call out of the assert call and use assert
only on the result value of the call.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>