There is one case where populate_obc_watchers gets called when the object
is missing: during a revert. And in that case we *should* do the populate,
since all that is getting reverted is the object version.
Fixes: #3405
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Sam Just <sam.just@inktank.com>
warning: mds/MDS.cc:1586:27: ignoring return value of ‘char* getcwd(char*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
Signed-off-by: Sage Weil <sage@inktank.com>
This effectively reverts faddb80c42
which prevented vstart.sh from being used in an enviroment where
CEPH_BIN pointed to a make install target.
Signed-off-by: Sam Lang <sam.lang@inktank.com>
Previously we would explicitly STAT the object to see if it exists before
sending the write to the OSD. Instead, send the write optimistically, and
assert that the object already exists. This avoids an extra round trip in
the optimistic/common case, and makes the existence check in the initial
first-write case more expensive because we send the data payload along.
Signed-off-by: Sage Weil <sage@inktank.com>
Add a guard operation for writes that asserts that the object already
exists. To avoid requiring new functionality on the OSD side, implement
this by including a STAT operation, and discard the results on the
client side.
Signed-off-by: Sage Weil <sage@inktank.com>
The fault() call in connect should not set onread=true since connect is
effectively a write path. This was forcing the writer() into a tight
loop that repeatedly would call connect(); not very polite.
Changing that, we want to avoid treating this as a normal fault (with the
failure callback) and instead back off.
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
We can't check the initial permissions of the
file because the umask may be set to something
other than 0022. The check isn't needed to check
for chmod correctness anyway.
Signed-off-by: Sam Lang <sam.lang@inktank.com>
Fixes: #3381
We check the return code of the cio->write() operation
when doing get_obj(). This makes sure that we don't
continue processing the request if client has disconnected.
This commit complements another commit that does the same
for the specific s3 operation.
backport: argonaut
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Turn these into asserts. The only two callers are create_object_context()
and get_object_context(), and they only get called when the object is no
longer missing.
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
Bug #3142 appears to be caused by the following sequence:
- object X missing on primary and replica
- [assert-ver,watch], notify, unwatch requests come in, get deferred
- object is recovered on primary, !missing, create_object_context
- populate_obc_watchers() does nothing, since still degraded
- notify happens now (odd but ok?)
- replica recovered, !degraded
- watch skips bc of bad assert
- unwatch trips up on an assert because populate_obc_watchers never
ran
Fix this by populating the obc watcher when !missing, not when
!degraded. This conditional dates back to Sam's original watch/notify
cleanup in October 2011.
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
This makes coverity happier because we check_op_pool_dne() may free
the Op (or Lingerop) structure(s), but the callers in the submit_*
paths dereference after calling. This is actually safe because they
never free new ops, but is confusing. Explicitly push this into a
separate helper.
CID 739607 (#1-2 of 2): Read from pointer after free (USE_AFTER_FREE)
At (9): Dereferencing freed pointer "o".
CID 739606 (#1 of 1): Read from pointer after free (USE_AFTER_FREE)
At (28): Dereferencing freed pointer "op".
Signed-off-by: Sage Weil <sage@inktank.com>
CID 717032 (#1 of 1): Big parameter passed by value (PASS_BY_VALUE)
Passing parameter i of type entity_inst_t (size 152 bytes) by value.
Signed-off-by: Sage Weil <sage@inktank.com>
At (6): Non-static class member field "layout.fl_stripe_unit" is not initialized in this constructor nor in any functions that it calls.
At (8): Non-static class member field "layout.fl_stripe_count" is not initialized in this constructor nor in any functions that it calls.
At (10): Non-static class member field "layout.fl_object_size" is not initialized in this constructor nor in any functions that it calls.
At (12): Non-static class member field "layout.fl_cas_hash" is not initialized in this constructor nor in any functions that it calls.
At (14): Non-static class member field "layout.fl_object_stripe_unit" is not initialized in this constructor nor in any functions that it calls.
At (16): Non-static class member field "layout.fl_unused" is not initialized in this constructor nor in any functions that it calls.
CID 717224 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
At (18): Non-static class member field "layout.fl_pg_pool" is not initialized in this constructor nor in any functions that it calls.
Signed-off-by: Sage Weil <sage@inktank.com>
At (2): Non-static class member "m_object_no" is not initialized in this constructor nor in any functions that it calls.
At (4): Non-static class member "m_object_off" is not initialized in this constructor nor in any functions that it calls.
CID 717222 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
At (6): Non-static class member "m_object_len" is not initialized in this constructor nor in any functions that it calls.
CID 717223 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
At (2): Non-static class member "m_parent_overlap" is not initialized in this constructor nor in any functions that it calls.
Signed-off-by: Sage Weil <sage@inktank.com>
CID 717044: Big parameter passed by value (PASS_BY_VALUE)
Passing parameter to of type entity_inst_t (size 152 bytes) by value.
CID 717045: Big parameter passed by value (PASS_BY_VALUE)
Passing parameter a of type entity_addr_t (size 136 bytes) by value.
Signed-off-by: Sage Weil <sage@inktank.com>
CID 717039 (#1 of 1): Big parameter passed by value (PASS_BY_VALUE)
Passing parameter my_addr of type entity_addr_t (size 136 bytes) by value.
CID 717040: Big parameter passed by value (PASS_BY_VALUE)
Passing parameter a of type entity_addr_t (size 136 bytes) by value.
CID 717041: Big parameter passed by value (PASS_BY_VALUE)
Passing parameter a of type entity_addr_t (size 136 bytes) by value.
CID 717043: Big parameter passed by value (PASS_BY_VALUE)
Passing parameter a of type entity_addr_t (size 136 bytes) by value.
Signed-off-by: Sage Weil <sage@inktank.com>
If we don't have the inode, release the caps. There is no point in adding
it to our cache, and that is problematic anyway because it ends up with a
ref count of zero and no dentry that will get trimmed by trim_cache(),
leaving it stuck there on shutdown.
This also aligns us with the kernel client behavior.
Signed-off-by: Sage Weil <sage@inktank.com>
Daemons will require cephx.
Clients will require nothing (i.e., will be able to connect to a cluster
with auth disabled).
See #3136
Signed-off-by: Sage Weil <sage@inktank.com>
This case shouldn't ever happen, but we've seen it, so there's a bug
somewhere. Handling a Session close when the Session is already closed
is easy, though -- we don't need to do anything!
Signed-off-by: Greg Farnum <greg@inktank.com>