In the rados.cc special case to handle put an empty objects, use
write_full() instead of create().
A special case was introduced 6843a0b81f
to create() an object if the rados put file is empty. Prior to this fix
an attempt to rados put an empty file was a noop. The problem with this
fix is that it is not idempotent. rados put an empty file twice would
fail the second time and rados put a file with one byte would succeed as
expected.
Signed-off-by: Loic Dachary <loic-201408@dachary.org>
expect_false does not extend past the pipe and fails because the command
succeeds
introduced in f05c977bbc
Signed-off-by: Loic Dachary <loic-201408@dachary.org>
Use strncpy() instead of strcpy and make sure the result
is '\0' terminated.
Fix for:
CID 1063700 (#1 of 1): Copy into fixed size buffer (STRING_OVERFLOW)
fixed_size_dest: You might overrun the 4088 byte fixed-size string
vol_args.name by copying the return value of c_str without checking
the length.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
shutdown() resets initialized to 0, but we can still receive messages
after this point, so fix message handlers to skip messages in this
case instead of asserting.
Also read initialized while holding Objecter::rwlock to avoid races
where e.g. handle_osd_map() checks initialized -> 1, continues,
shutdown() is called, sets initialized to 0, then handle_osd_map()
goes about its business and calls op_submit(), which would fail the
assert(initialized.read()) check. Similar races existed in other
message handlers which change Objecter state.
The Objecter is not destroyed until after its Messenger in
the MDS, OSD, and librados, so this should be safe.
Fixes: #9617
Backport: giant
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Fixes: #9013
Originally the configurable was empty, now setting explicitly both
fastcgi and civetweb (on port 7480).
Reviewed-by: Sage Weil <sage@redhat.com>
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Fix for:
const: At condition do_sync, the value of do_sync must be equal to 0.
dead_error_condition: The condition do_sync cannot be true.
CID 716893 (#1 of 1): Logically dead code (DEADCODE)
dead_error_begin: Execution cannot reach this statement op.OSDOp()
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix for coverity issue:
const: At condition unsafe > 0, the value of unsafe must be equal to 0.
dead_error_condition: The condition unsafe > 0 cannot be true.
CID 716892 (#1 of 1): Logically dead code (DEADCODE)
dead_error_begin: Execution cannot reach this statement
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 1240202 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member prio is not initialized
in this constructor nor in any functions that it calls.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
This is done in fedora packaging. Do it here too so that you can move
between upstream packages (from ceph.com) and fedora and other derivatives
will builds.
Backport: firefly, dumpling
Signed-off-by: Sage Weil <sage@redhat.com>
Fix two other paths where may change the mon state so that we wait for the
pending write first. start_election() in particular can be triggered at
almost any time if we see an election message from another mon.
Signed-off-by: Sage Weil <sage@redhat.com>
We are hitting a strange issue with valgrind and pthread spinlocks. Avoid
the issue by using an atomic_t here (which is simpler anyway).
Avoids: #8822
Backport: firefly
Signed-off-by: Sage Weil <sage@redhat.com>
The ctime changes any time the inode does. That can happen even without
the file itself having changed, so we'd better accept the update whenever
the auth caps have dirtied, without worrying about the file caps!
Fixes: #9514
Backport: firefly
Signed-off-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: John Spray <john.spray@redhat.com>