Re: [PATCH 1/3] Preserve the dirty bit in init_page_buffers

2007-05-31 Thread Andrew Morton
On Thu, 31 May 2007 05:56:33 -0600 [EMAIL PROTECTED] (Eric W. Biederman) wrote: > >> I suspect that is a pretty rare case but it does indeed seem to exist > >> as a problem. > > > > I think so too. But either we have some misunderstanding of the > > codepaths involved, or the author of the comment

Re: [PATCH 1/3] Preserve the dirty bit in init_page_buffers

2007-05-31 Thread Eric W. Biederman
Nick Piggin <[EMAIL PROTECTED]> writes: > Eric W. Biederman wrote: >> Nick Piggin <[EMAIL PROTECTED]> writes: > >>> However we >>>could still set_page_dirty of a block device page without buffers >>>via an mmap. >> >> >> After the page is made dirty via mmap we have: >> sys_write -> ... -> block_p

Re: [PATCH 1/3] Preserve the dirty bit in init_page_buffers

2007-05-28 Thread Eric W. Biederman
Nick Piggin <[EMAIL PROTECTED]> writes: > Eric W. Biederman wrote: >> Nick Piggin <[EMAIL PROTECTED]> writes: > >>> However we >>>could still set_page_dirty of a block device page without buffers >>>via an mmap. >> >> >> After the page is made dirty via mmap we have: >> sys_write -> ... -> block_p

Re: [PATCH 1/3] Preserve the dirty bit in init_page_buffers

2007-05-28 Thread Nick Piggin
Eric W. Biederman wrote: Nick Piggin <[EMAIL PROTECTED]> writes: However we could still set_page_dirty of a block device page without buffers via an mmap. After the page is made dirty via mmap we have: sys_write -> ... -> block_prepare_write -> ... -> create_empty_buffers. Yep, that's wha

Re: [PATCH 1/3] Preserve the dirty bit in init_page_buffers

2007-05-28 Thread Eric W. Biederman
Nick Piggin <[EMAIL PROTECTED]> writes: > Nick Piggin wrote: >> Eric W. Biederman wrote: > >>> When we initialize the ramdisk by writing to /dev/ram0 usually in >>> init/do_mounts_rd.c we don't allocate buffer heads but we do set >>> the dirty bit, and the page is in the page cache. So when we >>

Re: [PATCH 1/3] Preserve the dirty bit in init_page_buffers

2007-05-28 Thread Eric W. Biederman
Nick Piggin <[EMAIL PROTECTED]> writes: >> Definitely, and it was a royal pain to trace the bug that this >> caused. An initial ramdisk having pieces disappear after mkfs >> is called can look like the entire machine is dying. >> >> When we initialize the ramdisk by writing to /dev/ram0 usually i

Re: [PATCH 1/3] Preserve the dirty bit in init_page_buffers

2007-05-28 Thread Eric W. Biederman
Nick Piggin <[EMAIL PROTECTED]> writes: > Eric W. Biederman wrote: >> Nick Piggin <[EMAIL PROTECTED]> writes: > >>>I would have thought we can fix this simply by removing the >>>broken ramdisk_set_page_dirty (as far as the comment goes, we >>>set CAP_NO_ACCT_DIRTY anyway, so the normal set_page_di

Re: [PATCH 1/3] Preserve the dirty bit in init_page_buffers

2007-05-27 Thread Nick Piggin
Eric W. Biederman wrote: Nick Piggin <[EMAIL PROTECTED]> writes: Eric W. Biederman wrote: The problem: When we are trying to free buffers try_to_free_buffers will look at ramdisk pages with clean buffer heads and remove the dirty bit from the page. Resulting in ramdisk pages with data that

Re: [PATCH 1/3] Preserve the dirty bit in init_page_buffers

2007-05-27 Thread Nick Piggin
Nick Piggin wrote: Eric W. Biederman wrote: When we initialize the ramdisk by writing to /dev/ram0 usually in init/do_mounts_rd.c we don't allocate buffer heads but we do set the dirty bit, and the page is in the page cache. So when we later call getblk it reuses the same page and then calls

Re: [PATCH 1/3] Preserve the dirty bit in init_page_buffers

2007-05-27 Thread Nick Piggin
Eric W. Biederman wrote: Nick Piggin <[EMAIL PROTECTED]> writes: Eric W. Biederman wrote: The problem: When we are trying to free buffers try_to_free_buffers will look at ramdisk pages with clean buffer heads and remove the dirty bit from the page. Resulting in ramdisk pages with data that

Re: [PATCH 1/3] Preserve the dirty bit in init_page_buffers

2007-05-27 Thread Eric W. Biederman
Nick Piggin <[EMAIL PROTECTED]> writes: > Eric W. Biederman wrote: >> The problem: When we are trying to free buffers try_to_free_buffers >> will look at ramdisk pages with clean buffer heads and remove the >> dirty bit from the page. Resulting in ramdisk pages with data that >> get removed from

Re: [PATCH 1/3] Preserve the dirty bit in init_page_buffers

2007-05-27 Thread Nick Piggin
Eric W. Biederman wrote: The problem: When we are trying to free buffers try_to_free_buffers will look at ramdisk pages with clean buffer heads and remove the dirty bit from the page. Resulting in ramdisk pages with data that get removed from the page cache. Ouch! Buffer heads appear on ramdi

[PATCH 1/3] Preserve the dirty bit in init_page_buffers

2007-05-21 Thread Eric W. Biederman
The problem: When we are trying to free buffers try_to_free_buffers will look at ramdisk pages with clean buffer heads and remove the dirty bit from the page. Resulting in ramdisk pages with data that get removed from the page cache. Ouch! Buffer heads appear on ramdisk pages when a filesystem