mirror of
https://github.com/ceph/ceph
synced 2025-01-29 14:34:40 +00:00
Merge pull request #42308 from jtlayton/wip-51644
osd: don't assert on zero-length OP_ZERO request Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
This commit is contained in:
commit
13c2a0e948
@ -6811,8 +6811,7 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
|
||||
if (result < 0)
|
||||
break;
|
||||
|
||||
ceph_assert(op.extent.length);
|
||||
if (obs.exists && !oi.is_whiteout()) {
|
||||
if (op.extent.length && obs.exists && !oi.is_whiteout()) {
|
||||
t->zero(soid, op.extent.offset, op.extent.length);
|
||||
interval_set<uint64_t> ch;
|
||||
ch.insert(op.extent.offset, op.extent.length);
|
||||
|
@ -163,6 +163,14 @@ TEST_F(LibRadosIo, AppendRoundTrip) {
|
||||
ASSERT_EQ(0, memcmp(buf3 + sizeof(buf), buf2, sizeof(buf2)));
|
||||
}
|
||||
|
||||
TEST_F(LibRadosIo, ZeroLenZero) {
|
||||
rados_write_op_t op = rados_create_write_op();
|
||||
ASSERT_TRUE(op);
|
||||
rados_write_op_zero(op, 0, 0);
|
||||
ASSERT_EQ(0, rados_write_op_operate(op, ioctx, "foo", NULL, 0));
|
||||
rados_release_write_op(op);
|
||||
}
|
||||
|
||||
TEST_F(LibRadosIo, TruncTest) {
|
||||
char buf[128];
|
||||
char buf2[sizeof(buf)];
|
||||
|
Loading…
Reference in New Issue
Block a user