Whamcloud - gitweb
LU-3202 osd: no inode::i_mutex inside osd_object_destroy
authorFan Yong <yong.fan@whamcloud.com>
Mon, 22 Apr 2013 06:06:40 +0000 (14:06 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 26 Apr 2013 06:30:54 +0000 (02:30 -0400)
commitdb57d4cb311b5987f1006d4284e3bd10399ae4bb
tree307ceeb1764c1dd9a6f93698a7f9a78a3443f207
parent7ef817c9af35fa8fe56ea911afa1e54d6db71c9b
LU-3202 osd: no inode::i_mutex inside osd_object_destroy

Originally, to control the race between the OI scrub inserting
OI mapping and the osd_object_destroy() removing OI mapping on
the same target, the inode::i_mutex was used.

But the unlink thread which called osd_object_destroy() already
started transaction handle. Such order is different from others
as to may cause some deadlock between transaction start and the
obtain inode::i_mutex.

So now, the osd_object_destroy() will not obtain inode::i_mutex,
instead, the OI scrub will check whether someone unlinked the
inode or not during the OI scrub rebuilding the OI mapping, and
remove the new-inserted OI mapping if the race happened.

Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: Ic5c2e2b1d967e52a2b980d4f6bcaed4bdcf8368b
Reviewed-on: http://review.whamcloud.com/6124
Tested-by: Hudson
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Cliff White <cliff.white@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/osd-ldiskfs/osd_handler.c
lustre/osd-ldiskfs/osd_scrub.c