From: Yan, Zheng Date: Tue, 24 Nov 2015 12:16:09 +0000 (+0800) Subject: mds: don't getxattr and setxattr at the same time X-Git-Tag: v10.1.0~176^2~1^2~21 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a2def5e29fec187093d6d406b349844be5b58140;p=ceph.git mds: don't getxattr and setxattr at the same time If an osd request contains write operation, the reply will not carry output data. So we can't getxattr and setxattr in single OSD request. Signed-off-by: Yan, Zheng --- diff --git a/src/mds/CInode.cc b/src/mds/CInode.cc index ed3e43dcec90..8a643277d303 100644 --- a/src/mds/CInode.cc +++ b/src/mds/CInode.cc @@ -3741,23 +3741,18 @@ void CInode::validate_disk_state(CInode::validated_data *results, object_t oid = CInode::get_object_name(in->ino(), frag_t(), ""); ObjectOperation fetch; - fetch.getxattr("parent", bt, bt_r); - // We want to tag even if we get ENODATA fetching the backtrace - fetch.set_last_op_flags(CEPH_OSD_OP_FLAG_FAILOK); + in->mdcache->mds->objecter->read(oid, object_locator_t(pool), fetch, CEPH_NOSNAP, + NULL, 0, fin); if (!tag.empty()) { + ObjectOperation scrub_tag; bufferlist tag_bl; ::encode(tag, tag_bl); - fetch.setxattr("scrub_tag", tag_bl); - } - if (tag.empty()) { - in->mdcache->mds->objecter->read(oid, object_locator_t(pool), fetch, CEPH_NOSNAP, - NULL, 0, fin); - } else { - SnapContext snapc; - in->mdcache->mds->objecter->mutate(oid, object_locator_t(pool), fetch, - snapc,ceph::real_clock::now( - g_ceph_context), 0, NULL, fin); + scrub_tag.setxattr("scrub_tag", tag_bl); + SnapContext snapc; + in->mdcache->mds->objecter->mutate(oid, object_locator_t(pool), scrub_tag, snapc, + ceph::real_clock::now(g_ceph_context), + 0, NULL, NULL); } }