Re: [PATCH] Fix vmtruncate race and distributed filesystem race

Andrew Morton (akpm@digeo.com)
Thu, 12 Jun 2003 14:44:18 -0700


Dave McCracken <dmccr@us.ibm.com> wrote:
>
>
> --On Thursday, June 12, 2003 14:00:14 -0700 Andrew Morton <akpm@digeo.com>
> wrote:
>
> > And this does require that ->nopage be entered with page_table_lock held,
> > and that it drop it.
>
> I think that's a worse layer violation than referencing inode in
> do_no_page. We shouldn't require that the filesystem layer mess with the
> page_table_lock.

Well it is not "worse". Futzing with i_sem in do_no_page() is pretty gross.
You could add vm_ops->prevalidate() or something if it worries you.

btw, it should be synchronising with
file->f_dentry->d_inode->i_mapping->host->i_sem, not
file->f_dentry->d_inode->i_sem. do_truncate() also seems to be taking the
(potentially) wrong semaphore.

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