From: rread Date: Wed, 7 May 2003 09:12:44 +0000 (+0000) Subject: r=phil@clusterfs.com X-Git-Tag: v1_7_100~1^368~104 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=03089e7b1f36aee8865aac627f8d8b037bd2658b;p=fs%2Flustre-release.git r=phil@clusterfs.com - protect the obd_exports list with obd_lock - get a reference on the export from the list - and release the reference when done. --- diff --git a/lustre/obdclass/statfs_pack.c b/lustre/obdclass/statfs_pack.c index a86f017..1a5f6fa 100644 --- a/lustre/obdclass/statfs_pack.c +++ b/lustre/obdclass/statfs_pack.c @@ -72,13 +72,19 @@ int obd_self_statfs(struct obd_device *obd, struct statfs *sfs) int rc; ENTRY; + LASSERT( obd != NULL ); + + spin_lock(&obd->obd_dev_lock); if (list_empty(&obd->obd_exports)) { + spin_unlock(&obd->obd_dev_lock); export = my_export = class_new_export(obd); if (export == NULL) RETURN(-ENOMEM); } else { export = list_entry(obd->obd_exports.next, typeof(*export), exp_obd_chain); + export = class_export_get(export); + spin_unlock(&obd->obd_dev_lock); } conn.cookie = export->exp_handle.h_cookie; @@ -88,6 +94,8 @@ int obd_self_statfs(struct obd_device *obd, struct statfs *sfs) if (my_export) class_unlink_export(my_export); + + class_export_put(export); RETURN(rc); }