ceph: fix freeing inode vs removing session caps race
authorYan, Zheng <zheng.z.yan@intel.com>
Wed, 24 Jul 2013 04:22:11 +0000 (12:22 +0800)
committerSage Weil <sage@inktank.com>
Sat, 10 Aug 2013 00:55:32 +0000 (17:55 -0700)
commit6f60f889470aecf747610279545c054a99aadca3
tree60f5781c7673d1d0e06ef1b658e652b2738daf24
parent4d1829a59de402fc95daf4576c51aa0a7439aee8
ceph: fix freeing inode vs removing session caps race

remove_session_caps() uses iterate_session_caps() to remove caps,
but iterate_session_caps() skips inodes that are being deleted.
So session->s_nr_caps can be non-zero after iterate_session_caps()
return.

We can fix the issue by waiting until deletions are complete.
__wait_on_freeing_inode() is designed for the job, but it is not
exported, so we use lookup inode function to access it.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
fs/ceph/inode.c
fs/ceph/mds_client.c
fs/ceph/super.h