From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [84.204.75.148] (helo=shelob.oktetlabs.ru) by canuck.infradead.org with esmtps (Exim 4.52 #1 (Red Hat Linux)) id 1EFpPe-0001ti-0z for linux-mtd@lists.infradead.org; Thu, 15 Sep 2005 04:48:20 -0400 Message-ID: <43293527.9010504@yandex.ru> Date: Thu, 15 Sep 2005 12:47:35 +0400 From: "Artem B. Bityuckiy" MIME-Version: 1.0 To: Peter Menzebach References: <432812E8.2030807@mw-itcon.de> <432817FF.10307@yandex.ru> <4329251C.7050102@mw-itcon.de> <43292A8B.4020707@yandex.ru> <43292E94.4020702@mw-itcon.de> In-Reply-To: <43292E94.4020702@mw-itcon.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: linux-mtd@lists.infradead.org Subject: Re: data loss on jffs2 filesystem on dataflash List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Peter Menzebach wrote: > - if (!jffs2_can_mark_obsolete(c) && c->nextblock && (c->nextblock->free_size & (c->wbuf_pagesize-1))) { > + if (!jffs2_can_mark_obsolete(c) && c->nextblock && (c->nextblock->free_size % c->wbuf_pagesize)) { [snip] > - uint32_t skip = c->nextblock->free_size & (c->wbuf_pagesize-1); > + uint32_t skip = c->nextblock->free_size % c->wbuf_pagesize; [snip] > -#ifdef CONFIG_JFFS2_FS_WRITEBUFFER > #define PAGE_DIV(x) ( ((unsigned long)(x) / (unsigned long)(c->wbuf_pagesize)) * (unsigned long)(c->wbuf_pagesize) ) > #define PAGE_MOD(x) ( (unsigned long)(x) % (unsigned long)(c->wbuf_pagesize) ) > -#else > -#define PAGE_DIV(x) ( (x) & (~(c->wbuf_pagesize - 1)) ) > -#define PAGE_MOD(x) ( (x) & (c->wbuf_pagesize - 1) ) > -#endif Looks sane. -- Best Regards, Artem B. Bityuckiy, St.-Petersburg, Russia.