osd: return EINVAL when snapc is invalid and trying to write

This commit is contained in:
Yehuda Sadeh 2010-06-09 13:49:54 -07:00
parent e74250d82c
commit 1a3fac44f2

View File

@ -1019,8 +1019,11 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops,
}
// make writeable (i.e., clone if necessary)
if (is_modify)
if (is_modify) {
if (!ctx->snapc.is_valid())
return -EINVAL;
make_writeable(ctx);
}
// munge ZERO -> TRUNCATE? (don't munge to DELETE or we risk hosing attributes)
if (op.op == CEPH_OSD_OP_ZERO &&