Re: [PATCH] proc: stop using BKL

From: Christoph Hellwig
Date: Fri Oct 24 2008 - 11:55:27 EST


On Fri, Oct 24, 2008 at 03:46:06PM +0400, Alexey Dobriyan wrote:
> 3) proc_readdir_de()
> --------------------
> "." and ".." part doesn't need BKL, walking PDE list is under
> proc_subdir_lock, calling filldir callback is potentially blocking
> because it writes to luserspace. All proc_readdir_de() callers
> eventually come from ->readdir hook which is under directory's
> ->i_mutex -- BKL doesn't protect anything.
>
> 4) proc_root_readdir_de()
> -------------------------
> proc_root_readdir_de is ->readdir hook, see (3).
>
> Signed-off-by: Alexey Dobriyan <adobriyan@xxxxxxxxx>

Once you stop taking BKL in readdir you also need to switch to
generic_file_llseek for those directories. It would be good if you
could switch the fallback proc_reg_llseek to no llseek at all in
proc_reg_llseek while you're at it. I'll prepare a similar change
for non-procfs fops instances.

--
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/