On 01/27/2014 09:10 PM, Sage Weil wrote:
> In src/osd/ReplicatedPG.cc:
>
>> @@ -2348,7 +2348,7 @@ int ReplicatedPG::do_xattr_cmp_u64(int op, __u64 v1, bufferlist& xattr)
>>  int ReplicatedPG::do_xattr_cmp_str(int op, string& v1s, bufferlist& xattr)
>>  {
>>    const char *v1, *v2;
>> -  v1 = v1s.data();
>> +  v1 = v1s.c_str();
>
> i wonder if it would be simpler to convert xattr to a std::string and
> use std::string::compare
> (http://www.cplusplus.com/reference/string/string/compare/) (more or
> less equivalent to strcmp)
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/ceph/ceph/pull/1150/files#r9217786>.
>

It's much simpler, and what I did at first, but it also changes the
behavior for xattrs containing null characters (I was adding tests for
this in the new librados c objectoperation bindings when I noticed
this). I think we should at least use this version for dumpling, though
I'd be ok with changing to compare() and adding a release note for next.