All of lore.kernel.org
 help / color / mirror / Atom feed
* set_page_dirty vs set_page_dirty_lock
@ 2005-12-08 19:09 Michael S. Tsirkin
  2005-12-08 19:19 ` Hugh Dickins
  0 siblings, 1 reply; 14+ messages in thread
From: Michael S. Tsirkin @ 2005-12-08 19:09 UTC (permalink / raw)
  To: Hugh Dickins
  Cc: Gleb Natapov, Benjamin Herrenschmidt, Petr Vandrovec,
	Nick Piggin, Badari Pulavarty, Linux Kernel Mailing List

Hi!
The comment at set_page_dirty_lock says:

/*
 * set_page_dirty() is racy if the caller has no reference against
 * page->mapping->host, and if the page is unlocked.  This is because another
 * CPU could truncate the page off the mapping and then free the mapping.
 *
 * Usually, the page _is_ locked, or the caller is a user-space process which
 * holds a reference on the inode by having an open file.
 *
 * In other cases, the page should be locked before running set_page_dirty().
 */

Still, I wander whether it might be OK to use set_page_dirty
in another case - if I previously got a reference to the page
with get_user_pages?
The page wouldnt be written back in this case, would it?
What if I'm in the middle of a system call?

Thanks,

-- 
MST

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2005-12-13 21:04 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-08 19:09 set_page_dirty vs set_page_dirty_lock Michael S. Tsirkin
2005-12-08 19:19 ` Hugh Dickins
2005-12-08 19:29   ` Michael S. Tsirkin
2005-12-08 19:54   ` Jens Axboe
2005-12-08 21:56   ` Michael S. Tsirkin
2005-12-12  3:28     ` Nick Piggin
2005-12-12  6:35       ` Michael S. Tsirkin
2005-12-12  7:10         ` Nick Piggin
2005-12-12  8:14           ` Michael S. Tsirkin
2005-12-12  8:32             ` Nick Piggin
2005-12-12  8:55               ` Michael S. Tsirkin
2005-12-12  9:23                 ` Nick Piggin
2005-12-12  9:59                   ` Michael S. Tsirkin
2005-12-13 21:07                   ` Michael S. Tsirkin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.