Re: [PATCH] jbd jbd2: fix diowritereturningEIOwhentry_to_release_page fails
From: Hisashi Hifumi <hidden>
Date: 2008-08-13 06:02:23
Also in:
linux-fsdevel
At 05:06 08/08/13, Mingming Cao wrote:
quoted
With that said, I don't have strong feelings against falling back to buffered IO when the invalidate fails.It seems a little odd that we have to back to buffered IO in this case. The pages are all flushed, DIO just want to make sure the journaltransactions who still keep those buffers are removed from their list. It did that, the only reason to keep DIO fail is someone else hasn't release the bh. Current code enforce all the buffers have to be freed and pages are removed from page cache, in order to force later read are from disk. I am not sure why can't we just leave the page in the cache, just clear it uptodate flag, without reduce the page ref count? I think DIO should proceed it's IO in this case...
Like this? Following patch just clears PG_uptodate when try_to_release_page fails. diff -Nrup linux-2.6.27-rc3.org/mm/truncate.c linux-2.6.27-rc3/mm/truncate.c
--- linux-2.6.27-rc3.org/mm/truncate.c 2008-08-13 13:48:48.000000000 +0900
+++ linux-2.6.27-rc3/mm/truncate.c 2008-08-13 14:24:47.000000000 +0900@@ -345,8 +345,10 @@ invalidate_complete_page2(struct address if (page->mapping != mapping) return 0; - if (PagePrivate(page) && !try_to_release_page(page, GFP_KERNEL)) - return 0; + if (PagePrivate(page) && !try_to_release_page(page, GFP_KERNEL)) { + ClearPageUptodate(page); + return 1; + } spin_lock_irq(&mapping->tree_lock); if (PageDirty(page))
But this patch may cause some issue. See, http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=84209e02de48d72289650cc5a7ae8dd18223620f;hp=2b12a4c524812fb3f6ee590a02e65b95c8c32229 ClearPageUptodate in truncate.c was removed at 2.6.27-rc2 because this triggers some problems around NFS,FUSE,madvice.