* [Fwd: Re: a problem about jffs2]
@ 2005-11-10 11:55 Artem B. Bityutskiy
2005-11-11 3:32 ` zhao, forrest
0 siblings, 1 reply; 3+ messages in thread
From: Artem B. Bityutskiy @ 2005-11-10 11:55 UTC (permalink / raw)
To: linux-mtd; +Cc: luyang_ly
Just forwarding to the appropriate mailing list.
Artem.
-------- Original Message --------
Subject: Re: a problem about jffs2
Date: Wed, 9 Nov 2005 20:02:02 -0800 (PST)
From: Linus Torvalds <torvalds@osdl.org>
To: Thomas Gleixner <tglx@linutronix.de>, David Woodhouse
<dwmw2@infradead.org>, "Artem B. Bityutskiy" <dedekind@infradead.org>,
Todd Poynor <tpoynor@mvista.com>, Ferenc Havasi <havasi@inf.u-szeged.hu>
References: <BAY114-F29E1CCEFBD64791D2C1DC28D660@phx.gbl>
Just forwarding to people who are more appropriate.
Linus
--
YangLu YangLu <luyang_ly@hotmail.com>
On Thu, 10 Nov 2005, YangLu YangLu wrote:
>
> Dear Linus:
>
> I recently meet a problem about jffs2.
>
> There have three sectors in my mobilephone(OMAP730):
> /dev/mtdblock3 16384 3276 13108 20% /System
> /dev/mtdblock4 2048 388 1660 19% /Sysdisk
> /dev/mtdblock5 5120 388 4732 8% /Appdisk
>
> I built new file(ph_bk) in /Sysdisk dirctory. I write a test
> program, as follows:
> 1) open it.
> fd = fopen(argv[1], "r+");
> 2) fseek with a random number, then write a number
> for (;;) {
> offset = rand();
> fseek(fd, offset % (1024*1024), SEEK_SET);
> fwrite(&offset,sizeof(int), 1, fd);
> }
>
> I want to limit the file with 1M size, but when the test program run
> in background,
> this file maintain 1M size, but available space on /dev/mtdblock4
> continue to reduce, as below:
> Filesystem 1k-blocks Used Available Use% Mounted on
> /dev/mtdblock4 2048 512 1536 25% /Sysdisk
> /dev/mtdblock4 2048 688 1360 34% /Sysdisk
> /dev/mtdblock4 2048 792 1256 39% /Sysdisk
> /dev/mtdblock4 2048 856 1192 42% /Sysdisk
> /dev/mtdblock4 2048 1212 836 59% /Sysdisk
> /dev/mtdblock4 2048 1516 532 74% /Sysdisk
> /dev/mtdblock4 2048 1920 128 94% /Sysdisk
>
> Is it jffs2 filesystem's bug?
>
> Thanks!
>
> Best Regards,
> Richard
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Fwd: Re: a problem about jffs2]
2005-11-10 11:55 [Fwd: Re: a problem about jffs2] Artem B. Bityutskiy
@ 2005-11-11 3:32 ` zhao, forrest
2005-11-11 5:30 ` YangLu YangLu
0 siblings, 1 reply; 3+ messages in thread
From: zhao, forrest @ 2005-11-11 3:32 UTC (permalink / raw)
To: Artem B. Bityutskiy; +Cc: luyang_ly, linux-mtd
> > Dear Linus:
> >
> > I recently meet a problem about jffs2.
> >
> > There have three sectors in my mobilephone(OMAP730):
> > /dev/mtdblock3 16384 3276 13108 20% /System
> > /dev/mtdblock4 2048 388 1660 19% /Sysdisk
> > /dev/mtdblock5 5120 388 4732 8% /Appdisk
> >
> > I built new file(ph_bk) in /Sysdisk dirctory. I write a test
> > program, as follows:
> > 1) open it.
> > fd = fopen(argv[1], "r+");
> > 2) fseek with a random number, then write a number
> > for (;;) {
> > offset = rand();
> > fseek(fd, offset % (1024*1024), SEEK_SET);
> > fwrite(&offset,sizeof(int), 1, fd);
> > }
> >
> > I want to limit the file with 1M size, but when the test program run
> > in background,
> > this file maintain 1M size, but available space on /dev/mtdblock4
> > continue to reduce, as below:
> > Filesystem 1k-blocks Used Available Use% Mounted on
> > /dev/mtdblock4 2048 512 1536 25% /Sysdisk
> > /dev/mtdblock4 2048 688 1360 34% /Sysdisk
> > /dev/mtdblock4 2048 792 1256 39% /Sysdisk
> > /dev/mtdblock4 2048 856 1192 42% /Sysdisk
> > /dev/mtdblock4 2048 1212 836 59% /Sysdisk
> > /dev/mtdblock4 2048 1516 532 74% /Sysdisk
> > /dev/mtdblock4 2048 1920 128 94% /Sysdisk
> >
> > Is it jffs2 filesystem's bug?
> >
I once did some testing like yours, and had the same result.
I would say that this is an intrinsic nature of JFFS2 instead of a
JFFS2's bug.
Updating 4 bytes of a file for every write operation will cause
flash space wasting since every write operation generate an
jffs2_raw_inode + 4 bytes on flash. sizeof(jffs2_raw_inode) is 68 bytes.
Thanks,
Forrest
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Fwd: Re: a problem about jffs2]
2005-11-11 3:32 ` zhao, forrest
@ 2005-11-11 5:30 ` YangLu YangLu
0 siblings, 0 replies; 3+ messages in thread
From: YangLu YangLu @ 2005-11-11 5:30 UTC (permalink / raw)
To: forrest.zhao, linux-mtd; +Cc: dedekind
But in linux-2.4.18(Now in linux-2.6.12) with same flash(NOR),
I used the same test routine, available space on /dev/mtdblock4
would not continue to reduce.
Had GC's method been changed?
Thanks!
Regards,
Richard
>From: "zhao, forrest" <forrest.zhao@intel.com>
>To: "Artem B. Bityutskiy" <dedekind@yandex.ru>
>CC: linux-mtd@lists.infradead.org, luyang_ly@hotmail.com
>Subject: Re: [Fwd: Re: a problem about jffs2]
>Date: Fri, 11 Nov 2005 11:32:27 +0800
>
>
> > > Dear Linus:
> > >
> > > I recently meet a problem about jffs2.
> > >
> > > There have three sectors in my mobilephone(OMAP730):
> > > /dev/mtdblock3 16384 3276 13108 20% /System
> > > /dev/mtdblock4 2048 388 1660 19% /Sysdisk
> > > /dev/mtdblock5 5120 388 4732 8% /Appdisk
> > >
> > > I built new file(ph_bk) in /Sysdisk dirctory. I write a test
> > > program, as follows:
> > > 1) open it.
> > > fd = fopen(argv[1], "r+");
> > > 2) fseek with a random number, then write a number
> > > for (;;) {
> > > offset = rand();
> > > fseek(fd, offset % (1024*1024), SEEK_SET);
> > > fwrite(&offset,sizeof(int), 1, fd);
> > > }
> > >
> > > I want to limit the file with 1M size, but when the test program run
> > > in background,
> > > this file maintain 1M size, but available space on /dev/mtdblock4
> > > continue to reduce, as below:
> > > Filesystem 1k-blocks Used Available Use% Mounted on
> > > /dev/mtdblock4 2048 512 1536 25% /Sysdisk
> > > /dev/mtdblock4 2048 688 1360 34% /Sysdisk
> > > /dev/mtdblock4 2048 792 1256 39% /Sysdisk
> > > /dev/mtdblock4 2048 856 1192 42% /Sysdisk
> > > /dev/mtdblock4 2048 1212 836 59% /Sysdisk
> > > /dev/mtdblock4 2048 1516 532 74% /Sysdisk
> > > /dev/mtdblock4 2048 1920 128 94% /Sysdisk
> > >
> > > Is it jffs2 filesystem's bug?
> > >
>I once did some testing like yours, and had the same result.
>
>I would say that this is an intrinsic nature of JFFS2 instead of a
>JFFS2's bug.
>Updating 4 bytes of a file for every write operation will cause
>flash space wasting since every write operation generate an
>jffs2_raw_inode + 4 bytes on flash. sizeof(jffs2_raw_inode) is 68 bytes.
>
>Thanks,
>Forrest
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-11-11 5:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-10 11:55 [Fwd: Re: a problem about jffs2] Artem B. Bityutskiy
2005-11-11 3:32 ` zhao, forrest
2005-11-11 5:30 ` YangLu YangLu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox