On Fri, 2008-10-10 at 02:50 +1100, npiggin@xxxxxxx wrote: > plain text document attachment (mm-wcp-integrity-fix.patch) > In write_cache_pages, nr_to_write is heeded even for data-integrity syncs, so > the function will return success after writing out nr_to_write pages, even if > that was not sufficient to guarantee data integrity. > > The callers tend to set it to values that could break data interity semantics > easily in practice. For example, nr_to_write can be set to mapping->nr_pages * > 2, however if a file has a single, dirty page, then fsync is called, subsequent > pages might be concurrently added and dirtied, then write_cache_pages might > writeout two of these newly dirty pages, while not writing out the old page > that should have been written out. > > Fix this by ignoring nr_to_write if it is a data integrity sync. > Thanks for working on these. We should have a wbc->integrity flag because WB_SYNC_NONE is somewhat over used, and it is often used in data integrity syncs. See fs/sync.c:do_sync_mapping_range() There are many valid uses where we don't want to wait on pages that are already writeback but we do want to write everything else. -chris -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html