lkml.org 
[lkml]   [2006]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [patch 3/3] fs: fix cont vs deadlock patches
    From
    Date
    Nick Piggin <npiggin@suse.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.
    --
    OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2006-12-01 15:53    [W:0.022 / U:0.396 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site