X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fobdclass%2Fgenops.c;h=9c0563359fef7d034cedfb488550637727acdf95;hb=7a48c2efa0ee9d0b09a4d850a7acfb87adb642fa;hp=560ab8afb5b0d9f6d6bdfaa8a73db3e50d79a2a9;hpb=6867d7abdb9905da98d8e90b8dc65d84a7656363;p=fs%2Flustre-release.git diff --git a/lustre/obdclass/genops.c b/lustre/obdclass/genops.c index 560ab8a..9c05633 100644 --- a/lustre/obdclass/genops.c +++ b/lustre/obdclass/genops.c @@ -1235,6 +1235,13 @@ int class_disconnect(struct obd_export *export) spin_lock(&export->exp_lock); already_disconnected = export->exp_disconnected; export->exp_disconnected = 1; + /* We hold references of export for uuid hash + * and nid_hash and export link at least. So + * it is safe to call cfs_hash_del in there. */ + if (!hlist_unhashed(&export->exp_nid_hash)) + cfs_hash_del(export->exp_obd->obd_nid_hash, + &export->exp_connection->c_peer.nid, + &export->exp_nid_hash); spin_unlock(&export->exp_lock); /* class_cleanup(), abort_recovery(), and class_fail_export() @@ -1248,11 +1255,6 @@ int class_disconnect(struct obd_export *export) CDEBUG(D_IOCTL, "disconnect: cookie %#llx\n", export->exp_handle.h_cookie); - if (!hlist_unhashed(&export->exp_nid_hash)) - cfs_hash_del(export->exp_obd->obd_nid_hash, - &export->exp_connection->c_peer.nid, - &export->exp_nid_hash); - class_export_recovery_cleanup(export); class_unlink_export(export); no_disconn: