File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 1515 * limitations under the License.
1616 */
1717
18- #include " ep_time.h"
1918#include " item.h"
19+ #include " ep_time.h"
2020#include " item_eviction.h"
21+ #include " logtags.h"
2122#include " objectregistry.h"
2223
2324#include < folly/lang/Assume.h>
@@ -488,7 +489,14 @@ Item::WasValueInflated Item::removeUserXattrs() {
488489 const auto valNBytes = value->valueSize ();
489490 cb::char_buffer valBuf{const_cast <char *>(value->getData ()), valNBytes};
490491 const auto bodySize = valNBytes - cb::xattr::get_body_offset (valBuf);
491- Expects (bodySize == 0 );
492+ if (bodySize > 0 ) {
493+ std::stringstream ss;
494+ ss << *this ;
495+ throw std::logic_error (
496+ " Item::removeUserXattrs: Unexpected body (size " +
497+ std::to_string (bodySize) + " ) in deletion: " +
498+ cb::UserDataView (ss.str ()).getSanitizedValue ());
499+ }
492500
493501 // Operate on a copy
494502 const cb::xattr::Blob originalBlob (valBuf, false /* compressed*/ );
You can’t perform that action at this time.
0 commit comments