Please don't reply to lustre-devel. Instead, comment in Bugzilla by using the 
following link:
https://bugzilla.lustre.org/show_bug.cgi?id=10866



from irc discussion, the plan is this:
1. declare a global rw_sem to cover all proc file manipulation
Please don't reply to lustre-devel. Instead, comment in Bugzilla by using the 
following link:
2. write our own lproc_fops (https://bugzilla.lustre.org/attachment.cgi?id=9148)
that should be used to call all of our read_proc and write_procs.  These fops
will hold a read lock, check for non-null private data, call the
read/write_proc, and drop the read lock.
3. any proc that uses the seq_operations should be mostly replaced by a macro
(LPROC_SEQ_FOPS in b1_5), which will also hold the read lock between the .open
and .release fops.  
4. hold a write lock during the proc file removal, and set the private data to
null inside that lock.

The above insures that no proc files are read/written after lprocfs_remove has
been called (generally meaning obd cleanup method was called).  However, there
may still be particular elements referenced in some proc files that may be
destroyed earlier than obd cleanup.  This can be addressed in a combination of
either of two ways:
1. Take appropriate locks and check inside the individual proc.
2. Move the lprocfs_obd_cleanup call to an earlier point in the obd cleanup
(e.g. precleanup stage OBD_CLEANUP_SELF_EXPORT), where this data is known to
still be safe.

_______________________________________________
Lustre-devel mailing list
[email protected]
https://mail.clusterfs.com/mailman/listinfo/lustre-devel

Reply via email to