Messages in this thread | | | Date | Sun, 02 Apr 2006 15:17:44 +1000 | From | Nick Piggin <> | Subject | Re: smp race fix between invalidate_inode_pages* and do_no_page |
| |
Hi Andrea, seems good to me.
Andrea Arcangeli wrote:
> The PG_truncate is needed as well because we can't know in do_no_page if > page->mapping is legitimate null or not (think bttv and other device > drivers returning page->mapping null because they're private but not > reserved pages etc..) > > From: Andrea Arcangeli <andrea@suse.de> > Subject: avoid race between invalidate_inode_pages2 and do_no_page > > Use page lock and new bitflag to serialize. >
As clean upstream solution, could we make truncatable (ie. regular file backed) mappings set a vma flag which changes its nopage protocol to return a locked page?
filemap_nopage itself, rather than do_no_page would then take care of handling the truncate races. That seems to be a better layer to handle it in.
Also, after this there should be no reason for truncate_count, right? (At least in its truncate/nopage capacity.) If so, we should remove it as part of the same patch / patchset.
-- SUSE Labs, Novell Inc. Send instant messages to your online friends http://au.messenger.yahoo.com
- 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/
| |