Re: [PATCH 2/2] vfs: fix d_path() for unreachable paths

From: Mike Frysinger
Date: Mon Sep 21 2009 - 11:31:10 EST


On Mon, Sep 21, 2009 at 10:38, Al Viro wrote:
> On Mon, Sep 21, 2009 at 10:10:17AM -0400, Mike Frysinger wrote:
>> it works without having to copy & paste the same exact structures over
>> and over. Âa suggestion as how to do it cleanly without bloating the
>> code is certainly welcome. Âit doesnt really matter that it's on the
>> stack as the usage is small and d_path() is given the size of the
>> buffer, so it isnt going to overflow.
>
> Umm... ÂSurely, you can put a CPU number + one bit into PDE->data? ÂAs in
> Â Â Â Âproc_create_data("icplb", ....., (void *)(cpu * 2))
> Â Â Â Âproc_create_data("dcplb", ....., (void *)(cpu * 2 + 1))
> and
> Â Â Â Âstruct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode);
> Â Â Â Âunsigned long n = (unsigned long) pde->data;
> Â Â Â Â...
> Â Â Â Âcpu = n / 2;
> Â Â Â Âis_D = n & 1;

if i'd known this route, i'd have used it ;). i'll look into changing
it, thanks.

>> > ??For another... locking in that loop
>> > over processes and VMAs of each looks very suspicios, while we are at it.
>>
>> we've reviewed it several times and exercised it in multiple ways. Âso
>> unless you have a real idea of something being wrong, the code has
>> been vetted heavily.
>
> write_lock_irq tasklist_lock
> loop over processes
> Â Â Â Âget_task_mm [now VM is pinned down, but not locked]
> Â Â Â Âwalk the VMA list without any locking
>
> Something on another CPU (you have SMP systems, judging by the previously
> discussed code, right?) does munmap().

the SMP port is limited due to lack of hardware cache coherency, but
we'll check out this call path
-mike
--
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/