diff --git a/lustre/include/lprocfs_status.h b/lustre/include/lprocfs_status.h index 8c50f59fb6363d9eafeb557fd767e748810fd088..e5c01389b1f5ed57c3fc2d094d153324d3a53b29 100644 --- a/lustre/include/lprocfs_status.h +++ b/lustre/include/lprocfs_status.h @@ -527,6 +527,12 @@ extern struct rw_semaphore _lprocfs_lock; return -ENODEV; \ } \ } while(0) +#define LPROCFS_WRITE_ENTRY() do { \ + down_write(&_lprocfs_lock); \ +} while(0) +#define LPROCFS_WRITE_EXIT() do { \ + up_write(&_lprocfs_lock); \ +} while(0) /* You must use these macros when you want to refer to * the import in a client obd_device for a lprocfs entry */ diff --git a/lustre/obdclass/lprocfs_status.c b/lustre/obdclass/lprocfs_status.c index 660a4eb71aef01ab6c0331e9be50a780a09e9c61..310093c6f7839f3a82286cf93fa2f13d92ea4567 100644 --- a/lustre/obdclass/lprocfs_status.c +++ b/lustre/obdclass/lprocfs_status.c @@ -328,7 +328,7 @@ void lprocfs_remove(struct proc_dir_entry **rooth) parent = root->parent; LASSERT(parent != NULL); - LPROCFS_ENTRY(); /* search vs remove race */ + LPROCFS_WRITE_ENTRY(); /* search vs remove race */ while (1) { while (temp->subdir != NULL) @@ -350,7 +350,7 @@ void lprocfs_remove(struct proc_dir_entry **rooth) if (temp == parent) break; } - LPROCFS_EXIT(); + LPROCFS_WRITE_EXIT(); } struct proc_dir_entry *lprocfs_register(const char *name, @@ -1316,7 +1316,7 @@ void lprocfs_exp_print_hash(void *obj, void *cb_data) *data->len += lustre_hash_debug_header(data->page, data->count); - *data->len += lustre_hash_debug_str(lh, data->page + + *data->len += lustre_hash_debug_str(lh, data->page + *data->len, data->count); }