Whamcloud - gitweb
LU-7173 mdt: intent vs unlink race 01/17501/4
authorVitaly Fertman <vitaly.fertman@seagate.com>
Mon, 7 Dec 2015 18:37:46 +0000 (21:37 +0300)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 21 Dec 2015 12:41:32 +0000 (12:41 +0000)
commit9b520c36ddff687c51bea026d78380eb85981971
tree9203b848dd62ef62701c10389a11c1875f82ba79
parent2fe2d1e82005746180309d9b79057a418a729e54
LU-7173 mdt: intent vs unlink race

a race between intent and unlink results in working on stale object,
the intent resend finds the lock and !existent object and LBUG:
    ASSERTION( ((o)->lo_header->loh_attr & LOHA_EXISTS) != 0 )
in mdt_getattr_name_lock()->lu_object_attr(). a check for getattr is
added for !existent object in RESENT case.

another case is when resend finds inode cached on thread,
osd_iget_check() checking the inode returns ESTALE as nlinks==0.
ldlm_lock_enqueue() gets an error from ns_policy() and tries to
destroy the found lock, which is granted, getting "lock still on
resource" LBUG.

It is unclear if the lock reached the client in the original reply,
just leave the lock on server, not returning it again to the client.
Due to LU-6529, the server will not OOM in case the 2nd reply will
be handled on the client.

Signed-off-by: Vitaly Fertman <vitaly.fertman@seagate.com>
Change-Id: I128cd6eeda579c6477bf4564db5e551a46a74d71
Reviewed-on: http://es-gerrit.xyus.xyratex.com:8080/8849
Tested-by: Jenkins
Seagate-bug-id: MRP-3042
Reviewed-by: Alexander Nikolaevich Boyko <alexander.boyko@seagate.com>
Reviewed-by: Andriy Skulysh <andriy.skulysh@seagate.com>
Reviewed-by: Alexey Leonidovich Lyashkov <alexey.lyashkov@seagate.com>
Tested-by: Elena V. Gryaznova <elena.gryaznova@seagate.com>
Reviewed-on: http://review.whamcloud.com/17501
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Alexander Boyko <alexander.boyko@seagate.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/include/obd_support.h
lustre/ldlm/ldlm_lock.c
lustre/ldlm/ldlm_lockd.c
lustre/mdt/mdt_handler.c
lustre/ofd/ofd_io.c
lustre/osd-ldiskfs/osd_handler.c
lustre/osd-zfs/osd_oi.c
lustre/tests/recovery-small.sh
lustre/tests/sanity.sh