client: fix _create

make_request() clear out req->reply and frees req; we can't inspect
it here.

Instead, just assume that extra_bl is the create flag/ino if it is
present.  Old code does not include an extra_bl on CREATE, and new code
will have the same first bytes for compatibility.

Signed-off-by: Sage Weil <sage@inktank.com>
This commit is contained in:
Sage Weil 2012-12-31 15:23:29 -08:00
parent b4d3bd06d4
commit e2fef38dfd

View File

@ -6682,11 +6682,8 @@ int Client::_create(Inode *dir, const char *name, int flags, mode_t mode, Inode
goto reply_error;
}
// make sure we have a reply to inspect
assert(req->reply);
// check whether this request actually did the create, and set created flag
if (req->reply->get_connection()->has_feature(CEPH_FEATURE_REPLY_CREATE_INODE) && extra_bl.length() == 1) {
if (extra_bl.length() == 1) {
// if the extra bufferlist has a buffer, we assume its the created inode
// and that this request to create succeeded in actually creating
// the inode (won the race with other create requests)