Those are the only states where the replica can effectively prevent the
lock from cycling in a way that would force a frozen dirfrag beneath
the scatterpinned inode to update/journal something
(accounted_fragstat/rstat).
Signed-off-by: Sage Weil <sage@newdream.net>
CInode *diri = dir->inode;
if (!diri->can_scatter_pin()) {
dout(7) << "export_dir couldn't pin parent inode scatterlocks, failing. " << *diri << dendl;
+
+ // XXX we should make some effort to move lock(s) to a state where we _can_ export!
+
return;
}
}
bool can_scatter_pin(client_t loner) {
- return can_rdlock(-1) || can_wrlock(loner);
+ /*
+ LOCK : NOT okay because it can MIX and force replicas to journal something
+ TSYN : also not okay for same reason
+ EXCL : also not okay
+
+ MIX : okay, replica can stall before sending AC_SYNCACK
+ SYNC : okay, replica can stall before sending AC_MIXACK or AC_LOCKACK
+ */
+ return
+ get_state() == LOCK_SYNC ||
+ get_state() == LOCK_MIX;
}
xlist<ScatterLock*>::item *get_updated_item() { return &more()->item_updated; }