[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to load a file from kernel?



Hi,

I'm working on finishing the model-based compressor support for JFFS2 - 
in a way we discussed before.

Almost everything works but I've problem at loading the model files.

I know the inode number of the file, I can "iget" it and see its 
attributes, allocate memory for it. It's OK. But if I try to read the 
content of the file by jffs2_read_inode_range() there will be a lots of

Sep 27 22:07:45 kpax vmunix: bad: scheduling while atomic!
Sep 27 22:07:45 kpax vmunix:  [<c01064b3>] dump_stack+0x1e/0x22
Sep 27 22:07:45 kpax vmunix:  [<c031c348>] schedule+0x480/0x485
Sep 27 22:07:45 kpax vmunix:  [<c031c377>] preempt_schedule+0x2a/0x43
Sep 27 22:07:45 kpax vmunix:  [<c011a853>] release_console_sem+0xd9/0xe2
Sep 27 22:07:45 kpax vmunix:  [<c011a6b2>] printk+0x111/0x16c
Sep 27 22:07:45 kpax vmunix:  [<c0117b88>] __might_sleep+0xad/0xd3
Sep 27 22:07:45 kpax vmunix:  [<c0139d29>] kmem_cache_alloc+0x69/0x6b
Sep 27 22:07:45 kpax vmunix:  [<fb97eb4f>] 
jffs2_alloc_full_dnode+0x1b/0x1f [jffs2]
Sep 27 22:07:45 kpax vmunix:  [<fb97e1c8>] 
jffs2_get_inode_nodes+0x602/0xb35 [jffs2]
Sep 27 22:07:45 kpax vmunix:  [<fb982579>] 
jffs2_do_read_inode_internal+0x6e/0x542 [jffs2]
Sep 27 22:07:45 kpax vmunix:  [<fb982304>] 
jffs2_do_read_inode+0x8a/0x1fb [jffs2]
Sep 27 22:07:45 kpax vmunix:  [<fb98c043>] jffs2_read_inode+0x74/0x2b8 
[jffs2]
Sep 27 22:07:45 kpax vmunix:  [<fb97b303>] jffs2_model_load+0x154/0x161 
[jffs2]
Sep 27 22:07:45 kpax vmunix:  [<fb98cdc0>] jffs2_get_sb_mtd+0xf4/0x12a 
[jffs2]
Sep 27 22:07:45 kpax vmunix:  [<fb98cf80>] jffs2_get_sb+0x10a/0x243 [jffs2]
Sep 27 22:07:45 kpax vmunix:  [<c01546f7>] do_kern_mount+0x58/0xd2
Sep 27 22:07:45 kpax vmunix:  [<c0169daf>] do_new_mount+0x8b/0xc2
Sep 27 22:07:45 kpax vmunix:  [<c016a436>] do_mount+0x12e/0x171
Sep 27 22:07:45 kpax vmunix:  [<c016a83a>] sys_mount+0xb7/0x126
Sep 27 22:07:45 kpax vmunix:  [<c0105efb>] syscall_call+0x7/0xb

like messages - and the system halts.

I work with kernel version 2.6.8.1 with a fresh snaphot of mtd.

If I'm right this kind of usage of jffs2_read_inode_range() worked with 
earlier versions. I just tried out kernel_read() which also worked 
beforhand but now produces similar messages - and system halt.

Do you have some idea/advice how can I read the content of an inode?

Thanks,
Ferenc

To unsubscribe from this list: send the line "unsubscribe jffs-dev" in
the body of a message to majordomo@xxxxxxx.com