staging/lustre/mgc: detach MGC dev on error
authorBobi Jam <bobijam.xu@intel.com>
Thu, 26 Mar 2015 01:53:21 +0000 (21:53 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Mar 2015 10:10:24 +0000 (11:10 +0100)
commit4345abb2c3b56eae9bcf4728dcdc0f584690c8aa
treef7b193e34d0ac58fcc31e986db4dbd204bcb4be9
parent1c8aa54aaf2c74a28a9e427bb27fd1a12fca8536
staging/lustre/mgc: detach MGC dev on error

lustre_start_mgc() creates MGC device, if error happens later on
ll_fill_super(), this device is still attached, and later mount
fails by keep complaining that the MGC device's already in the
client node.

It turns out that the device was referenced by mgc config llog data
which is arranged in the mgc lock requeue thread re-trying to get its
mgc lock, and in normal case, this llog reference only released in
mgc_blocking_ast() when the system is umount.

This patch make mgc_precleanup() to wake up requeue thread to handle
the config llog data.

This patch also makes mgc_setup() wait for mgc_requeue_thread() start
before moving on.

Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Reviewed-on: http://review.whamcloud.com/11765
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4943
Reviewed-by: Ryan Haasken <haasken@cray.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/mgc/mgc_request.c