Check this early to avoid wasting effort, or causing side-effects from
do_osd_op_effects().
Signed-off-by: Sage Weil <sage@newdream.net>
bool head_existed = ctx->obs->exists;
+ // valid snap context?
+ if (!ctx->snapc.is_valid()) {
+ dout(10) << " invalid snapc " << ctx->snapc << dendl;
+ return -EINVAL;
+ }
+
// prepare the actual mutation
int result = do_osd_ops(ctx, ctx->ops);
if (result < 0)
// there was a modification!
-
- // valid snap context?
- if (!ctx->snapc.is_valid()) {
- dout(10) << " invalid snapc " << ctx->snapc << dendl;
- return -EINVAL;
- }
-
make_writeable(ctx);
if (ctx->user_modify) {