From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from an-out-0708.google.com ([209.85.132.248]) by canuck.infradead.org with esmtp (Exim 4.63 #1 (Red Hat Linux)) id 1HjXf4-0007pH-5Z for linux-mtd@lists.infradead.org; Thu, 03 May 2007 05:31:46 -0400 Received: by an-out-0708.google.com with SMTP id d40so1080046and for ; Thu, 03 May 2007 02:31:36 -0700 (PDT) Message-ID: Date: Thu, 3 May 2007 13:31:35 +0400 From: "Alexander Belyakov" To: "David Woodhouse" Subject: Re: [PATCH] [JFFS2] Non-contiguous write bug fix (Sibley) In-Reply-To: <1178125804.11120.67.camel@pmac.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1176908804.21611.37.camel@shinybook.infradead.org> <1178114314.11120.12.camel@pmac.infradead.org> <1178125804.11120.67.camel@pmac.infradead.org> Cc: linux-mtd@lists.infradead.org List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On 5/2/07, David Woodhouse wrote: > > Ah, I understand. So this should fix it? > > diff --git a/fs/jffs2/wbuf.c b/fs/jffs2/wbuf.c > index c556e85..91d1d0f 100644 > --- a/fs/jffs2/wbuf.c > +++ b/fs/jffs2/wbuf.c > @@ -637,7 +637,10 @@ static int __jffs2_flush_wbuf(struct jffs2_sb_info *c, int pad) > > memset(c->wbuf,0xff,c->wbuf_pagesize); > /* adjust write buffer offset, else we get a non contiguous write bug */ > - c->wbuf_ofs += c->wbuf_pagesize; > + if (SECTOR_ADDR(c->wbuf_ofs) == SECTOR_ADDR(c->wbuf_ofs+c->wbuf_pagesize)) > + c->wbuf_ofs += c->wbuf_pagesize; > + else > + c->wbuf_ofs = 0xffffffff; > c->wbuf_len = 0; > return 0; > } > Yes, it helps. Thanks, Alexander