public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* Flash_eraseall -j and cowardly refusing to mount
@ 2008-01-07 12:16 Phillips, Owain
  2008-01-07 12:40 ` Josh Boyer
  2008-01-07 15:00 ` David Woodhouse
  0 siblings, 2 replies; 4+ messages in thread
From: Phillips, Owain @ 2008-01-07 12:16 UTC (permalink / raw)
  To: linux-mtd

Hi linux-mtd@lists.infradead.org,

We just upgraded to mtd-utils-1.0.1 on our 2.6.23 target and I am getting
problems with flash_eraseall -j where the mount fails.

# flash_eraseall -j /dev/mtd11
Erasing 128 Kibyte @ e20000 -- 36 % complete. Cleanmarker written at e20000.
Skipping bad block at 0x00e40000
Erasing 128 Kibyte @ 26a0000 -- 99 % complete. Cleanmarker written at
26a0000.
# mount -t jffs2 /dev/mtdblock11 /mnt
Cowardly refusing to erase blocks on filesystem with no valid JFFS2 nodes
empty_blocks 0, bad_blocks 1, c->nr_blocks 310
mount: Mounting /dev/mtdblock11 on /mnt failed: Input/output error


If I do a flash_eraseall without the -j option the mount is OK.
Is it OK to revert to just doing this non-jffs2-aware erase; what are
implications/side effects?

If I look at the differences in the filesystems generated via the
flash_eraseall -y and a flash_eraseall followed by a mount the clean marker
appears to be different; is that the problem.

First oob for a flash_erase -j.....

0x000007e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x000007f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
  OOB Data: ff ff 85 19 03 20 08 00 00 00 ff ff ff ff ff ff
  OOB Data: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
  OOB Data: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
  OOB Data: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff

First oob for a flash_erase, followed by jffs2 mount....

0x000007e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x000007f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
  OOB Data: ff ff 85 19 03 20 08 00 00 00 00 00 00 00 ff ff
  OOB Data: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
  OOB Data: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
  OOB Data: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff

Here are details for our device.

# mtd_debug info /dev/mtd11
mtd.type = MTD_NANDFLASH
mtd.flags =
mtd.size = 40632320 (38M)
mtd.erasesize = 131072 (128K)
mtd.oobblock = 2048 (2K)
mtd.oobsize = 64
mtd.ecctype = (unknown ECC type - new MTD API maybe?) regions = 0
#


Any help in pointing out the error of my ways would be greatly appreciated.
Does it look like we cocked up building the mtd utils?

Kind regards,
Owain Phillips
--

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Flash_eraseall -j and cowardly refusing to mount
  2008-01-07 12:16 Flash_eraseall -j and cowardly refusing to mount Phillips, Owain
@ 2008-01-07 12:40 ` Josh Boyer
  2008-01-07 15:00 ` David Woodhouse
  1 sibling, 0 replies; 4+ messages in thread
From: Josh Boyer @ 2008-01-07 12:40 UTC (permalink / raw)
  To: Phillips, Owain; +Cc: linux-mtd

On Mon, 07 Jan 2008 12:16:45 +0000
"Phillips, Owain" <owain.phillips@siemens.com> wrote:

> Hi linux-mtd@lists.infradead.org,
> 
> We just upgraded to mtd-utils-1.0.1 on our 2.6.23 target and I am getting
> problems with flash_eraseall -j where the mount fails.
> 
> # flash_eraseall -j /dev/mtd11
> Erasing 128 Kibyte @ e20000 -- 36 % complete. Cleanmarker written at e20000.
> Skipping bad block at 0x00e40000
> Erasing 128 Kibyte @ 26a0000 -- 99 % complete. Cleanmarker written at
> 26a0000.
> # mount -t jffs2 /dev/mtdblock11 /mnt
> Cowardly refusing to erase blocks on filesystem with no valid JFFS2 nodes
> empty_blocks 0, bad_blocks 1, c->nr_blocks 310
> mount: Mounting /dev/mtdblock11 on /mnt failed: Input/output error
> 
> 
> If I do a flash_eraseall without the -j option the mount is OK.
> Is it OK to revert to just doing this non-jffs2-aware erase; what are
> implications/side effects?
> 
> If I look at the differences in the filesystems generated via the
> flash_eraseall -y and a flash_eraseall followed by a mount the clean marker
> appears to be different; is that the problem.
> 
> First oob for a flash_erase -j.....
> 
> 0x000007e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0x000007f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>   OOB Data: ff ff 85 19 03 20 08 00 00 00 ff ff ff ff ff ff
>   OOB Data: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>   OOB Data: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>   OOB Data: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 
> First oob for a flash_erase, followed by jffs2 mount....
> 
> 0x000007e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0x000007f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>   OOB Data: ff ff 85 19 03 20 08 00 00 00 00 00 00 00 ff ff
>   OOB Data: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>   OOB Data: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>   OOB Data: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 
> Here are details for our device.
> 
> # mtd_debug info /dev/mtd11
> mtd.type = MTD_NANDFLASH
> mtd.flags =
> mtd.size = 40632320 (38M)
> mtd.erasesize = 131072 (128K)
> mtd.oobblock = 2048 (2K)
> mtd.oobsize = 64
> mtd.ecctype = (unknown ECC type - new MTD API maybe?) regions = 0
> #
> 
> 
> Any help in pointing out the error of my ways would be greatly appreciated.
> Does it look like we cocked up building the mtd utils?

No.  I think the -j option to flash_eraseall is broken.  It should
either be fixed or removed.

josh

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Flash_eraseall -j and cowardly refusing to mount
  2008-01-07 12:16 Flash_eraseall -j and cowardly refusing to mount Phillips, Owain
  2008-01-07 12:40 ` Josh Boyer
@ 2008-01-07 15:00 ` David Woodhouse
  2008-01-07 18:39   ` Jeff Hane
  1 sibling, 1 reply; 4+ messages in thread
From: David Woodhouse @ 2008-01-07 15:00 UTC (permalink / raw)
  To: Phillips, Owain; +Cc: linux-mtd

On Mon, 2008-01-07 at 12:16 +0000, Phillips, Owain wrote:
> Hi linux-mtd@lists.infradead.org,
> 
> We just upgraded to mtd-utils-1.0.1 on our 2.6.23 target and I am
> getting problems with flash_eraseall -j where the mount fails.

It ought to be fixed by this:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=09b3fba5

-- 
dwmw2

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Flash_eraseall -j and cowardly refusing to mount
  2008-01-07 15:00 ` David Woodhouse
@ 2008-01-07 18:39   ` Jeff Hane
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff Hane @ 2008-01-07 18:39 UTC (permalink / raw)
  To: David Woodhouse; +Cc: linux-mtd


 But doesn't this only fix the case where you have contiguous 8 bytes to
write the cleanmarker?  flash_eraseall -j uses MTD_PLACE to write the
cleanmarker BUT jffs2 uses MTD_AUTO to read the cleanmarker.
 For example, if your oob area has byte 0 as the bad block indicator and
bytes 8-10 have ecc, there are only 7 consecutive free bytes.
flash_eraseall -j will only write 7 bytes so jffs2 will fail when
mounting the filesystem because it will read 8 bytes.  The 8th byte,
which will be byte 12, will still be FF.
  It seems there should be an ioctl that would allow one to read/write
the oob area using MTD_AUTO???

jeff

On Mon, 2008-01-07 at 15:00 +0000, David Woodhouse wrote:
> On Mon, 2008-01-07 at 12:16 +0000, Phillips, Owain wrote:
> > Hi linux-mtd@lists.infradead.org,
> > 
> > We just upgraded to mtd-utils-1.0.1 on our 2.6.23 target and I am
> > getting problems with flash_eraseall -j where the mount fails.
> 
> It ought to be fixed by this:
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=09b3fba5
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-01-07 18:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-07 12:16 Flash_eraseall -j and cowardly refusing to mount Phillips, Owain
2008-01-07 12:40 ` Josh Boyer
2008-01-07 15:00 ` David Woodhouse
2008-01-07 18:39   ` Jeff Hane

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox