[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4570CA90.8050203@yahoo.com.au>
Date: Sat, 02 Dec 2006 11:36:32 +1100
From: Nick Piggin <nickpiggin@...oo.com.au>
To: OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
CC: Nick Piggin <npiggin@...e.de>, Andrew Morton <akpm@...l.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-fsdevel@...r.kernel.org
Subject: Re: [patch 3/3] fs: fix cont vs deadlock patches
OGAWA Hirofumi wrote:
> Nick Piggin <npiggin@...e.de> writes:
>
>
>>>> status = __block_prepare_write(inode, new_page, zerofrom,
>>>> PAGE_CACHE_SIZE, get_block);
>>>> if (status)
>>>>@@ -2110,7 +2111,7 @@
>>>> memset(kaddr+zerofrom, 0, PAGE_CACHE_SIZE-zerofrom);
>>>> flush_dcache_page(new_page);
>>>> kunmap_atomic(kaddr, KM_USER0);
>>>>- generic_commit_write(NULL, new_page, zerofrom, PAGE_CACHE_SIZE);
>>>>+ __block_commit_write(inode, new_page, zerofrom, PAGE_CACHE_SIZE);
>>>
>>>Whatever function this is doesn't need to update i_size?
>>
>>Yes, it is the code in cont_prepare_write that is expanding a hole
>>at the end of file.
>>
>>We can do this now because fat_commit_write is now changed to call
>>generic_commit_write in the case of a non-zero length.
>>
>>I think it is an improvement because now the file will not get
>>arbitrarily extended in the case of a write failure somewhere down
>>the track.
>
>
> Ah, unfortunately we can't this. If we don't update ->i_size before
> page_cache_release, pdflush will think these pages is outside ->i_size
> and just clean the page without writing it.
I see. I guess you need to synchronise your writepage versus this
extention in order to handle it properly then. I won't bother with
that though: it won't be worse than it was before.
Thanks for review, do you agree with the other hunks?
--
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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists