From: OGAWA Hirofumi Subject: Re: [patch 3/3] fs: fix cont vs deadlock patches Date: Fri, 01 Dec 2006 23:50:49 +0900 Message-ID: <87slfzu0ty.fsf@duaron.myhome.or.jp> References: <20061130072058.GA18004@wotan.suse.de> <20061130072202.GB18004@wotan.suse.de> <20061130072247.GC18004@wotan.suse.de> <20061130113241.GC12579@wotan.suse.de> <87r6vkzinv.fsf@duaron.myhome.or.jp> <20061201020910.GC455@wotan.suse.de> <87mz68xoyi.fsf@duaron.myhome.or.jp> <20061201050852.GA31347@wotan.suse.de> <20061130232102.0cc7fc0b.akpm@osdl.org> <20061201075341.GB31347@wotan.suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Andrew Morton , Linux Kernel Mailing List , linux-fsdevel@vger.kernel.org Return-path: Received: from mail.parknet.jp ([210.171.160.80]:7436 "EHLO parknet.jp") by vger.kernel.org with ESMTP id S1758823AbWLAOu5 (ORCPT ); Fri, 1 Dec 2006 09:50:57 -0500 Received: from ibmpc.myhome.or.jp ([210.171.168.39]:4617) by parknet.jp with [XMail 1.21 ESMTP Server] id for from ; Fri, 1 Dec 2006 23:51:51 +0900 To: Nick Piggin In-Reply-To: <20061201075341.GB31347@wotan.suse.de> (Nick Piggin's message of "Fri\, 1 Dec 2006 08\:53\:41 +0100") Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Nick Piggin 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