Brian Behlendorf dba1d70566 Fix arc_adapt() spinning in iterate_supers_type()
The iterate_supers_type() function which was introduced in the
3.0 kernel was supposed to provide a safe way to call an arbitrary
function on all super blocks of a specific type.  Unfortunately,
because a list_head was used a bug was introduced which made it
possible for iterate_supers_type() to get stuck spinning on a
super block which was just deactivated.

This can occur because when the list head is removed from the
fs_supers list it is reinitialized to point to itself.  If the
iterate_supers_type() function happened to be processing the
removed list_head it will get stuck spinning on that list_head.

The bug was fixed in the 3.3 kernel by converting the list_head
to an hlist_node.  However, to resolve the issue for existing
3.0 - 3.2 kernels we detect when a list_head is used.  Then to
prevent the spinning from occurring the .next pointer is set to
the fs_supers list_head which ensures the iterate_supers_type()
function will always terminate.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1045
Closes #861
Closes #790
2013-07-17 09:28:06 -07:00
..
2010-08-31 13:41:27 -07:00
2013-04-24 16:18:53 -07:00
2011-04-19 10:10:47 -07:00
2012-10-14 13:06:48 -07:00
2013-03-18 15:33:17 -07:00
2013-04-02 10:48:26 -07:00
2013-03-18 15:33:17 -07:00
2010-08-31 13:41:27 -07:00
2010-08-31 13:41:27 -07:00
2010-08-31 13:41:27 -07:00
2011-01-28 12:45:19 -08:00
2010-08-31 13:41:27 -07:00
2013-03-06 15:46:41 -08:00
2013-04-24 16:18:55 -07:00
2013-04-24 16:18:49 -07:00