]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ceph: fix cap revoke race
authorYan, Zheng <zheng.z.yan@intel.com>
Tue, 2 Jul 2013 04:40:20 +0000 (12:40 +0800)
committerSage Weil <sage@inktank.com>
Wed, 3 Jul 2013 22:32:57 +0000 (15:32 -0700)
commitb1530f57042297f85330a140a6921b6f95fe74d3
tree0af45d94a71bd69d59aa0d2399a5c06623d9170c
parentb415bf4f9fe25f39934f5c464125e4a2dffb6d08
ceph: fix cap revoke race

If caps are been revoking by the auth MDS, don't consider them as
issued even they are still issued by non-auth MDS. The non-auth
MDS should also be revoking/exporting these caps, the client just
hasn't received the cap revoke/export message.

The race I encountered is: When caps are exporting to new MDS, the
client receives cap import message and cap revoke message from the
new MDS, then receives cap export message from the old MDS. When
the client receives cap revoke message from the new MDS, the revoking
caps are still issued by the old MDS, so the client does nothing.
Later when the cap export message is received, the client removes
the caps issued by the old MDS. (Another way to fix the race is
calling ceph_check_caps() in handle_cap_export())

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Reviewed-by: Sage Weil <sage@inktank.com>
fs/ceph/caps.c