Re: [PATCH] Fix dcache race during umount

From: Balbir Singh
Date: Tue Apr 04 2006 - 01:11:26 EST


> Trying again after some useful comments from Balbir.
> Note: the change to prune_dcache looks quite different now.
>
> NeilBrown
>
<snip>
> tmp = dentry_unused.prev;
> + if (unlikely(sb)) {
> + /* Try to find a dentry for this sb, but don't try
> + * too hard, if they aren't near the tail they will
> + * be moved down again soon
> + */
> + int skip = count;
> + while (skip &&
> + tmp != &dentry_unused &&
> + list_entry(tmp, struct dentry, d_lru)->d_sb != sb) {
> + skip--;
> + tmp = tmp->prev;
> + }
> + }

This code looks very similar to the first pass in dcache_shrink_sb().
I would prefer if we could re-use that code here, but that would
require creating a helper function by splitting the function.

Looks like a good solution to me.

Regards,
Balbir
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/