Whamcloud - gitweb
LU-464 obdfilter-survey test 2a ASSERT(imp->imp_sec == NULL)
authorLai Siyao <laisiyao@whamcloud.com>
Wed, 13 Jul 2011 08:00:40 +0000 (16:00 +0800)
committerOleg Drokin <green@whamcloud.com>
Fri, 15 Jul 2011 14:32:27 +0000 (07:32 -0700)
commit32ff1453bab3b1771d46b717df1ec479d156e5f8
tree208c698896843a0f150c8898618e5ab9468c3640
parente99739d9abf08ca8d76df281e481924fc2ae6849
LU-464 obdfilter-survey test 2a ASSERT(imp->imp_sec == NULL)

There is a race in echo client:
1. `lctl --device $echo_client_dev detach`
     -> class_detach() puts last refcount of export
       -> obd_zombie_add_export() adds this export in zombie list, and
            wake up zombie thread.
2. zombie thread culls this export:
     class_destroy_export() put last refcount of echo_client_dev
       -> obd_cleanup()
         -> echo_device_free()
           -> echo_client_cleanup()
             -> osc_disconnect()
               -> client_disconnect_export() will clear cli->cl_import
3. `lctl --device $osc_dev cleanup`
     -> osc_precleanup() find scli->cl_import is not NULL (this means
          import is never connected, but it's not true here)
       -> class_destroy_import()
         -> class_import_put()
           -> LASSERT(imp->imp_sec == NULL) fails

It's expected that step 2 is done before step 3, but this can't be
guaranteed currently. To ensure this, osc_precleanup() calls
obd_zombie_barrier() to ensure step 2 is finished.

Change-Id: I2d044c3ac45a72d305a369a1f31c315f36a7ce02
Signed-off-by: Lai Siyao <laisiyao@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/1093
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Mikhail Pershin <tappro@whamcloud.com>
Reviewed-by: Jinshan Xiong <jay@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/osc/osc_request.c