Order this op wrt reads the same way a read-modify-write would be.
(Otherwise we may get a fast/stale read result on a not-yet-complete
write.)
This fixes a problem where the Filer was marking a probe stat as a write
to get this same effect, but the OSD would EINVAL if it was a snapped
object (which happens in certain cases where the MDS is recovering the
file size of a snapped file).
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
CEPH_OSD_FLAG_EXEC = 0x0800, /* op may exec */
CEPH_OSD_FLAG_EXEC_PUBLIC = 0x1000, /* op may exec (public) */
CEPH_OSD_FLAG_LOCALIZE_READS = 0x2000, /* read from nearby replica, if any */
+ CEPH_OSD_FLAG_RWORDERED = 0x4000, /* order wrt concurrent reads */
};
enum {
bool ok;
dout(10) << "do_op mode is " << mode << dendl;
assert(!mode.wake); // we should never have woken waiters here.
- if (op->may_read() && op->may_write())
+ if ((op->may_read() && op->may_write()) ||
+ (op->get_flags() & CEPH_OSD_FLAG_RWORDERED))
ok = mode.try_rmw(client);
else if (op->may_write())
ok = mode.try_write(client);
dout(10) << "_probe probing " << p->oid << dendl;
C_Probe *c = new C_Probe(this, probe, p->oid);
probe->ops[p->oid] = objecter->stat(p->oid, p->oloc, probe->snapid, &c->size, &c->mtime,
- probe->flags | CEPH_OSD_FLAG_WRITE, c);
+ probe->flags | CEPH_OSD_FLAG_RWORDERED, c);
}
}