Messages in this thread | | | Date | Wed, 19 Mar 2014 21:02:33 -0700 | Subject | Re: [PATCH] fs/namespace: don't clobber mnt_hash.next while umounting [v2] | From | Linus Torvalds <> |
| |
On Wed, Mar 19, 2014 at 8:48 PM, Al Viro <viro@zeniv.linux.org.uk> wrote: > > NAK. Nice catch, the bug is real, but the fix is wrong. For one thing, > you have missed detach_mnt()/attach_mnt(), so you are not covering > all places where the sucker might be removed from the list. For another, > I don't believe that this is the right approach. > > The *only* thing we care about is not getting stuck in __lookup_mnt().
Quite frankly, if that's the main issue, then may I suggest aiming to use a 'hlist' instead of a doubly-linked list? Those have the advantage that they are NULL-terminated.
Yeah, hlists have some disadvantages too, which might not make them work in this case, but really, for mnt_hash? hlists are generally *exactly* what you want for hash lists, because the head is smaller. And because of the NULL termination rather than having the head used in the middle of a circular list, you don't get the termination problems when moving entries across chains.
I did not look whether there was some reason a hlist isn't appropriate here. Maybe you can tell me. Or go "yeah, a hlist would work nicely".
Linus
| |