* No space left on device
@ 2002-03-19 17:27 Sebastian
2002-03-20 17:27 ` David Woodhouse
0 siblings, 1 reply; 5+ messages in thread
From: Sebastian @ 2002-03-19 17:27 UTC (permalink / raw)
To: linux-mtd
Hi,
I'm trying to use JFFS2 on a 512K AMD (AM29F040B) flash chip (8 erase
blocks) installed on the IBM Walnut board. I was able to create a JFFS2
image with mkfs.jffs2, erase the flash, and then copy the image to the flash
( about 200 bytes). I can mount the mtdblock and browse the files on the
JFFS2 file system, but I cannot make any changes to the existing files or
add new ones. Everytime I try to modify it I get the 'No space left on
device' error. I had a quick look through the JFFS2 code and I see that
there has to be at least 5 free erase blocks (+ data) for the FS to function
properly ... but I have 8! I tried changing JFFS2_RESERVED_BLOCKS_BASE from
3 to 1 (which gives a total of 3 blocks for minimum requirement) and it
still didn't work. Am I missing something here? Do I have to pad my image
with 0xFF and make it 512K before I copy it? Is there another way to make
the image and copy it to the flash ... etc?
Regards,
Sebastian Vaitus
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: No space left on device
2002-03-19 17:27 No space left on device Sebastian
@ 2002-03-20 17:27 ` David Woodhouse
2002-03-27 18:49 ` Sebastian
0 siblings, 1 reply; 5+ messages in thread
From: David Woodhouse @ 2002-03-20 17:27 UTC (permalink / raw)
To: Sebastian; +Cc: linux-mtd
sebastian.vaitus@masstechgroup.com said:
> I was able to create a JFFS2 image with mkfs.jffs2, erase the flash,
> and then copy the image to the flash ( about 200 bytes). I can mount
> the mtdblock and browse the files on the JFFS2 file system, but I
> cannot make any changes to the existing files or add new ones.
> Everytime I try to modify it I get the 'No space left on device'
> error.
Please compile with CONFIG_JFFS2_FS_DEBUG=1, set the console loglevel to 9
so that you see all the KERN_DEBUG messages, and log the output over a
serial console while you reproduce this and also run 'df'.
--
dwmw2
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: No space left on device
2002-03-20 17:27 ` David Woodhouse
@ 2002-03-27 18:49 ` Sebastian
2002-03-27 19:13 ` David Woodhouse
0 siblings, 1 reply; 5+ messages in thread
From: Sebastian @ 2002-03-27 18:49 UTC (permalink / raw)
To: David Woodhouse; +Cc: linux-mtd
[-- Attachment #1: Type: text/plain, Size: 1288 bytes --]
David,
I have logged the output for the problem described in a previous email
(attached below). I am using 6 erase blocks this time instead of 8 (which
should still be enough for the 280 byte JFFS2 image). From what I saw in the
logs, I think that JFFS is only able to use the first block out of the 6 due
to some formatting or erasing problem with the rest of 5 blocks. Please have
a look at the attached log and maybe you'll be able to easily identify the
problem..
Regards,
Sebastian
>
> sebastian.vaitus@masstechgroup.com said:
> > I was able to create a JFFS2 image with mkfs.jffs2, erase the flash,
> > and then copy the image to the flash ( about 200 bytes). I can mount
> > the mtdblock and browse the files on the JFFS2 file system, but I
> > cannot make any changes to the existing files or add new ones.
> > Everytime I try to modify it I get the 'No space left on device'
> > error.
>
> Please compile with CONFIG_JFFS2_FS_DEBUG=1, set the console loglevel to 9
> so that you see all the KERN_DEBUG messages, and log the output over a
> serial console while you reproduce this and also run 'df'.
>
> --
> dwmw2
>
>
>
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/
>
>
[-- Attachment #2: jffs2_clean --]
[-- Type: application/octet-stream, Size: 10013 bytes --]
*** Make the jffs2 image
root@192.0.0.123:/jffs2#
root@192.0.0.123:/jffs2# mkfs.jffs2 -d ./imgdir -o jffs2.img
root@192.0.0.123:/jffs2# ls
imgdir jffs2.img
root@192.0.0.123:/jffs2# ls -l
total 8
drwxr-xr-x 2 root root 4096 Mar 27 2002 imgdir
-rw-r--r-- 1 root root 280 Mar 27 2002 jffs2.img
*** Copy the image to flash
root@192.0.0.123:/jffs2# cd ..
root@192.0.0.123:/# cat /proc/mtd
dev: size erasesize name
mtd0: 00060000 00010000 "Flash File System"
mtd1: 00020000 00010000 "ROM Monitor"
mtd2: 00080000 00010000 "Whole Flash"
root@192.0.0.123:/# eraseall /dev/mtd0
MTD_open
MTD_ioctl
MTD_ioctl
Erasing 64 Kibytodo: 1 0 0 0
te @ 0 -- 0 % complete.MTD_ioctl
Erasing 64 Kibytodo: 1 0 0 0
te @ 10000 -- 16 % complete.MTD_ioctl
Erasing 64 Kibytodo: 1 0 0 0
te @ 20000 -- 33 % complete.MTD_ioctl
Erasing 64 Kibytodo: 1 0 0 0
te @ 30000 -- 50 % complete.MTD_ioctl
Erasing 64 Kibytodo: 1 0 0 0
te @ 40000 -- 66 % complete.MTD_ioctl
Erasing 64 Kibytodo: 1 0 0 0
te @ 50000 -- 83 % complete.MTD_close
Erased 384 Kibyte @ 0 -- 100% complete.
root@192.0.0.123:/# cp /jffs2/jffs2.img /dev/mtd0
MTD_open
MTD_write
MTD_close
*** Mount the JFFS2 file system
root@192.0.0.123:/# cd mnt/flash
root@192.0.0.123:/mnt/flash# ls
root@192.0.0.123:/mnt/flash# cd ..
root@192.0.0.123:/mnt# mount -t jffs2 /dev/mtdblock0 /mnt/flash
mtdblock_open
ok
jffs2: read_super for device 1f:00
jffs2_scan_eraseblock(): Scanning block at 0x0
jffs2_scan_inode_node(): Node at 0x00000000
jffs2_get_ino_cache(): ino 1
jffs2_get_ino_cache found 00000000 for ino 1
Allocated inocache at c778c2d4
jffs2_add_ino_cache: Add c778c2d4 (ino #1)
Node is ino #1, version 1. Range 0x0-0x0
jffs2_scan_dirent_node(): Node at 0x00000044
jffs2_get_ino_cache(): ino 1
jffs2_get_ino_cache found c778c2d4 for ino 1
jffs2_add_fd_to_list( c70124c0, c70124a0 (->00000000))
Dirent "test" (hash 0x01c4ddc5, ino #2
jffs2_scan_inode_node(): Node at 0x00000070
jffs2_get_ino_cache(): ino 2
jffs2_get_ino_cache found 00000000 for ino 2
Allocated inocache at c778c2c0
jffs2_add_ino_cache: Add c778c2c0 (ino #2)
Node is ino #2, version 1. Range 0x0-0x1d
jffs2_scan_inode_node(): Node at 0x000000d0
jffs2_get_ino_cache(): ino 2
jffs2_get_ino_cache found c778c2c0 for ino 2
Node is ino #2, version 2. Range 0x1d-0x1f
Found empty flash at 0x118
Empty flash detected from 0x00000118 to 0x00010000
Block at 0x00000000: free 0x0000fee8, dirty 0x00000000, used 0x00000118
jffs2_scan_eraseblock(): Scanning block at 0x10000
Found empty flash at 0x10000
Empty flash detected from 0x00010000 to 0x00020000
Block at 0x00010000: free 0x00010000, dirty 0x00000000, used 0x00000000
JFFS2: Erase block at 0x00010000 is not formatted. It will be erased
jffs2_scan_eraseblock(): Scanning block at 0x20000
Found empty flash at 0x20000
Empty flash detected from 0x00020000 to 0x00030000
Block at 0x00020000: free 0x00010000, dirty 0x00000000, used 0x00000000
JFFS2: Erase block at 0x00020000 is not formatted. It will be erased
jffs2_scan_eraseblock(): Scanning block at 0x30000
Found empty flash at 0x30000
Empty flash detected from 0x00030000 to 0x00040000
Block at 0x00030000: free 0x00010000, dirty 0x00000000, used 0x00000000
JFFS2: Erase block at 0x00030000 is not formatted. It will be erased
jffs2_scan_eraseblock(): Scanning block at 0x40000
Found empty flash at 0x40000
Empty flash detected from 0x00040000 to 0x00050000
Block at 0x00040000: free 0x00010000, dirty 0x00000000, used 0x00000000
JFFS2: Erase block at 0x00040000 is not formatted. It will be erased
jffs2_scan_eraseblock(): Scanning block at 0x50000
Found empty flash at 0x50000
Empty flash detected from 0x00050000 to 0x00060000
Block at 0x00050000: free 0x00010000, dirty 0x00000000, used 0x00000000
JFFS2: Erase block at 0x00050000 is not formatted. It will be erased
Scanned flash completely
Pass 1: ino #1
jffs2_build_inode building inode #1
jffs2_get_ino_cache(): ino 2
jffs2_get_ino_cache found c778c2c0 for ino 2
Increased nlink for child "test" (ino #2)
Pass 1: ino #2
jffs2_build_inode building inode #2
adding node 0000-001d @0x00000070 on flash, newfrag *c778b2d4
adding node 001d-001f @0x000000d0 on flash, newfrag *c778b2c0
j_a_f_d_t_f: skipping frag 0x0000-0x001d; phys 0x00000070 (*c778b2d4->00000000)
Pass 1 complete
Pass 2 (re)starting
Pass 2: ino #1, nlink 1, ic c778c2d4, nodes c778f360
Pass 2: ino #2, nlink 1, ic c778c2c0, nodes c778f340
Pass 2 complete
Pass 3: ino #1, ic c778c2d4, nodes c778f360
Pass 3: ino #2, ic c778c2c0, nodes c778f340
Pass 3 complete
jffs2_read_super(): Getting root inode
jffs2_read_inode(): inode->i_ino == 1
getting inocache
jffs2_get_ino_cache(): ino 1
jffs2_get_ino_cache found c778c2d4 for ino 1
jffs2_read_inode(): Got inocache at c778c2d4
jffs2_read_inode(): ino #1 nlink is 1
jffs2_get_inode_nodes(): ino #1
Node at 00000044 is a dirent node
Adding fd "test", ino #2
jffs2_add_fd_to_list( c70124e0, c7429c1c (->00000000))
Dirent "test" (hash 0x01c4ddc5, ino #2
Node at 00000000 is a data node
version 1, highest_version now 2
dnode @00000000: ver 1, offset 0000, dsize 0000
metadata @00000000: ver 1
jffs2_read_inode() returning
jffs2_read_super(): d_alloc_root()
JFFS2: Garbage collect thread is pid 186
thread_should_wake(): nr_free_blocks 0, nr_erasing_blocks 5, dirty_size 0x0
jffs2_garbage_collect_thread sleeping...
thread_should_wake(): nr_free_blocks 0, nr_erasing_blocks 5, dirty_size 0x0
Starting erase of pending block 0x00050000
Freeing all node refs for eraseblock offset 0x00050000
todo: 1 0 0 0
Erase at 0x00050000 finished, but state != MTD_ERASE_DONE. State is 0x0 instead.
Starting erase of pending block 0x00040000
Freeing all node refs for eraseblock offset 0x00040000
todo: 1 0 0 0
Erase at 0x00040000 finished, but state != MTD_ERASE_DONE. State is 0x0 instead.
Starting erase of pending block 0x00030000
Freeing all node refs for eraseblock offset 0x00030000
todo: 1 0 0 0
Erase at 0x00030000 finished, but state != MTD_ERASE_DONE. State is 0x0 instead.
Starting erase of pending block 0x00020000
Freeing all node refs for eraseblock offset 0x00020000
todo: 1 0 0 0
Erase at 0x00020000 finished, but state != MTD_ERASE_DONE. State is 0x0 instead.
Starting erase of pending block 0x00010000
Freeing all node refs for eraseblock offset 0x00010000
todo: 1 0 0 0
Erase at 0x00010000 finished, but state != MTD_ERASE_DONE. State is 0x0 instead.
jffs2_erase_pending_blocks completed
root@192.0.0.123:/mnt# thread_should_wake(): nr_free_blocks 0, nr_erasing_blocks 0, dirty_size 0x0
jffs2_erase_pending_blocks completed
*** List files on JFFS2 drive
root@192.0.0.123:/mnt# cd flash
root@192.0.0.123:/mnt/flash# ls
jffs2_readdir() for dir_i #1
Dirent 0: ".", ino #1
Dirent 1: "..", ino #1
Dirent 2: "test", ino #2, type 8
jffs2_readdir() for dir_i #1
Skipping dirent: "test", ino #2, type 8, because curofs 2 < offset 3
test
*** Attempt to rename the file under JFFS2
root@192.0.0.123:/mnt/flash# mv test test1
jffs2_lookup()
jffs2_lookup()
jffs2_read_inode(): inode->i_ino == 2
getting inocache
jffs2_get_ino_cache(): ino 2
jffs2_get_ino_cache found c778c2c0 for ino 2
jffs2_read_inode(): Got inocache at c778c2c0
jffs2_read_inode(): ino #2 nlink is 1
jffs2_get_inode_nodes(): ino #2
Node at 000000d0 is a data node
version 2, highest_version now 2
dnode @000000d0: ver 2, offset 001d, dsize 0002
Node at 00000070 is a data node
version 1, highest_version now 2
dnode @00000070: ver 1, offset 0000, dsize 001d
jffs2_add_full_dnode_to_inode(ino #2, f c6fd8b10, fn c778d360)
adding node 0000-001d @0x00000070 on flash, newfrag *c778b2c0
frag 0000-001d: 0x00000070 on flash (*c778b2c0->00000000)
jffs2_add_full_dnode_to_inode(ino #2, f c6fd8b10, fn c778d350)
adding node 001d-001f @0x000000d0 on flash, newfrag *c778b2d4
j_a_f_d_t_f: skipping frag 0x0000-0x001d; phys 0x00000070 (*c778b2c0->00000000)
frag 0000-001d: 0x00000070 on flash (*c778b2c0->c778b2d4)
frag 001d-001f: 0x000000d0 on flash (*c778b2d4->00000000)
Truncating fraglist to 0x0000001f bytes
jffs2_read_inode() returning
jffs2_reserve_space(): Requested 0x30 bytes
jffs2_reserve_space(): alloc sem got
Short on space, but total dirty size 0x00000000 < sector size 0x00010000, so -ENOSPC
jffs2_create()
jffs2_reserve_space(): Requested 0x44 bytes
jffs2_reserve_space(): alloc sem got
Short on space, but total dirty size 0x00000000 < sector size 0x00010000, so -ENOSPC
jffs2_create(): reserved 0xc7aef000 bytes
mv: cannot create regular file `test1': No space left on device
*** Attempt to change permissions on file
root@192.0.0.123:/mnt/flash# chmod 777 test
jffs2_setattr(): ino #2
jffs2_reserve_space(): Requested 0x44 bytes
jffs2_reserve_space(): alloc sem got
Short on space, but total dirty size 0x00000000 < sector size 0x00010000, so -ENOSPC
chmod: changing permissions of `test': No space left on device
*** Attempt to create a directory
root@192.0.0.123:/mnt/flash# mkdir test123
jffs2_lookup()
jffs2_reserve_space(): Requested 0x44 bytes
jffs2_reserve_space(): alloc sem got
Short on space, but total dirty size 0x00000000 < sector size 0x00010000, so -ENOSPC
mkdir: cannot create directory `test123': No space left on device
*** DF
root@192.0.0.123:/mnt/flash# df
Filesystem STATFS:
flash_size: 00060000
used_size: 00000118
dirty_size: 00000000
free_size: 0000fee8
erasing_size: 00000000
bad_size: 00050000
sector_size: 00010000
nextblock: 0x00000000
gcblock: NULL
clean_list: empty
dirty_list: empty
erasing_list: empty
erase_pending_list: empty
free_list: empty
bad_list: 00010000
bad_list: 00020000
bad_list: 00030000
bad_list: 00040000
bad_list: 00050000
bad_used_list: empty
1k-blocks Used Available Use% Mounted on
/dev/root 2869272 1721132 1002384 64% /
/dev/mtdblock0 384 384 0 100% /mnt/flash
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: No space left on device
2002-03-27 18:49 ` Sebastian
@ 2002-03-27 19:13 ` David Woodhouse
2002-03-27 19:58 ` Sebastian
0 siblings, 1 reply; 5+ messages in thread
From: David Woodhouse @ 2002-03-27 19:13 UTC (permalink / raw)
To: Sebastian; +Cc: linux-mtd
sebastian.vaitus@masstechgroup.com said:
> Erase at 0x00010000 finished, but state != MTD_ERASE_DONE. State is
> 0x0 instead.
What hardware?
--
dwmw2
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: No space left on device
2002-03-27 19:13 ` David Woodhouse
@ 2002-03-27 19:58 ` Sebastian
0 siblings, 0 replies; 5+ messages in thread
From: Sebastian @ 2002-03-27 19:58 UTC (permalink / raw)
To: David Woodhouse; +Cc: linux-mtd
It's a 512K AMD flash with 8 erase blocks on an IBM Walnut board. The ROM
Monitor program which I use for booting takes up the last 2 blocks, and I'm
trying to use the first 6 blocks for JFFS.
I've attached a previous email below that gives more details.
Sebastian
Hi,
I'm trying to use JFFS2 on a 512K AMD (AM29F040B) flash chip (8 erase
blocks) installed on the IBM Walnut board. I was able to create a JFFS2
image with mkfs.jffs2, erase the flash, and then copy the image to the flash
( about 200 bytes). I can mount the mtdblock and browse the files on the
JFFS2 file system, but I cannot make any changes to the existing files or
add new ones. Everytime I try to modify it I get the 'No space left on
device' error. I had a quick look through the JFFS2 code and I see that
there has to be at least 5 free erase blocks (+ data) for the FS to function
properly ... but I have 8! I tried changing JFFS2_RESERVED_BLOCKS_BASE from
3 to 1 (which gives a total of 3 blocks for minimum requirement) and it
still didn't work. Am I missing something here? Do I have to pad my image
with 0xFF and make it 512K before I copy it? Is there another way to make
the image and copy it to the flash ... etc?
Regards,
Sebastian Vaitus
>
> sebastian.vaitus@masstechgroup.com said:
> > Erase at 0x00010000 finished, but state != MTD_ERASE_DONE. State is
> > 0x0 instead.
>
> What hardware?
>
> --
> dwmw2
>
>
>
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2002-03-27 19:57 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-03-19 17:27 No space left on device Sebastian
2002-03-20 17:27 ` David Woodhouse
2002-03-27 18:49 ` Sebastian
2002-03-27 19:13 ` David Woodhouse
2002-03-27 19:58 ` Sebastian
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox