Nick Piggin <[email protected]> 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.
--
OGAWA Hirofumi <[email protected]>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]