mds: document EXCL -> (MIX or SYNC) transition decision
Previously (in w26f6a8e48ae575f17c850e28e969d55bceefbc0f), for reasons that
are somewhat obscured by passage of time, we did
+ if ((other_wanted & (CEPH_CAP_GRD|CEPH_CAP_GWR)) ||
But then we noticed that the loner may want to RD/WR and we are losing the
loner status for some other reason. So just recently in
b48dfeba3f99451815a5e2a538bea15cd87220d2 we changed it to
+ if (((other_wanted|loner_wanted) & (CEPH_CAP_GRD|CEPH_CAP_GWR)) ||
Then we noticed that a non-loner wanting to read and a loner wanting to
read (i.e., no writers!) would lead to MIX, even when we want SYNC.
So in
07b36992da35e8b54acf76af6c893a0d86f048fb we changed to
+ if (((other_wanted|loner_wanted) & CEPH_CAP_GWR) ||
This appears to be correct. The possible choices (wrt caps wanted):
loner other want
R R SYNC
R R|W MIX
R W MIX
R|W R MIX
R|W R|W MIX
R|W W MIX
W R MIX
W R|W MIX
W W MIX
Which means any writer -> we want MIX. We only want SYNC when there is
nobody who wants to write. Because you can't write in SYNC. Which in
retrospect seems obvious.
Signed-off-by: Sage Weil <sage@inktank.com>