[parisc-linux] Re: [fuse-devel] Example filesystem fail to init on parisc

James Bottomley James.Bottomley at SteelEye.com
Sun Mar 19 08:46:31 MST 2006


On Sun, 2006-03-19 at 15:38 +0000, Hugh Dickins wrote:
> Certainly, that is part of what copy_to_user and get_user_pages(,,,,1,,,)
> (and ordinary userspace writing) guarantee.  So if there's some new route
> by which userspace pages may be modified on behalf of the user, never mind
> the architecture-specific cache coherency issues, COWs must be broken to
> preserve the semantics of fork.

Yes, that's where I think the problem lies.  For an anonymous unshared
page, the user view of the cache may still be dirty.  get_user_pages()
only seems to use flush_dcache_page() to restore coherency, which won't
work on anon pages.  Thus, get_user_pages() for an anon page is
returning a page to the kernel that still has an incoherent user cache,
which is what causes the issues in the copytest module.

> drivers/scsi/sg.c looks like it makes all the necessary calls to
> __copy_to_user or get_user_pages... but it's not hard to fool me.

Yes ... and the copytest module has an almost exact duplicate of that
code ... it's the actual get_user_pages() where I think we have
coherency issues ... I've verified that it is returning an incoherent
page if the underlying user page is PAGE_MAPPING_ANON.

James





More information about the parisc-linux mailing list