Problems unlinking files

Chris AtLee catlee at canada.com
Tue Jul 2 12:37:38 EDT 2002


Sorry for the delay, I was on vacation last week.  Attached is a log of
what I get with CONFIG_JFFS2_FS_DEBUG=1 and /proc/sys/kernel/printk = 9

In addition, I notice that if I keep unlinking the file, the link count
goes from 0 to 65535 then 65534, 65533, ...

I've put up a tarball with my 2.2.18 changes at:
http://atlee.ca/jffs2-2.2.18.tar.gz

Cheers,
Chris

On Wed, 2002-06-19 at 19:33, David Woodhouse wrote:
> 
> catlee at canada.com said:
> > I've noticed some problems with unlinking files with JFFS2 in my linux
> > 2.2.18 port.  After unlinking a file, it doesn't appear in the
> > directory listing, but if I do an 'ls' on the unlinked file, I can
> > still get information on the file.  I can still read and write to the
> > file, but it refuses to show up in the directory listing. After I
> > unmount the JFFS2 partition and remount it the file isn't there at
> > all.
> 
> Can you run with CONFIG_JFFS2_FS_DEBUG=1 and show the output while you 
> unlink the file, then open it again?
> 
> Preferably using a serial console, and they'll be KERN_DEBUG messages so 
> you'll need to echo 9 > /proc/sys/kernel/printk to make them get printed.
> 
> > Any ideas?  I'm sure I must have deleted something important getting
> > everything working with linux 2.2.18.
> 
> Show me your jffs2_unlink() and jffs2_do_unlink() -- and indeed the rest of 
> it :)
> 
> --
> dwmw2
> 
> 
> 

-------------- next part --------------
# touch test2
jffs2_readdir() for dir_i #1
Dirent 0: ".", ino #1
Dirent 1: "..", ino #1
jffs2_readdir() for dir_i #1
jffs2_readdir() for dir_i #1
Dirent 0: ".", ino #1
Dirent 1: "..", ino #1
jffs2_readdir() for dir_i #1
jffs2_lookup()
jffs2_create()
jffs2_new_inode(): dir_i 1, mode 0x81a4
Allocated inocache at c05181d0
jffs2_do_new_inode(): Assigned ino# 29
jffs2_reserve_space(): Requested 0x44 bytes
jffs2_reserve_space(): alloc sem got
jffs2_do_reserve_space(): Giving 0xf3a0 bytes at 0x1d0c60
jffs2_do_create(): reserved 0xf3a0 bytes
jffs2_add_physical_node_ref(): Node at 0x1d0c60, size 0x44
jffs2_write_dnode wrote node at 0x001d0c60 with dsize 0x0, csize 0x0, node_crc 0xe0303e57, data_crc 0x00000000, totlen 0x00000044
jffs2_do_create created file with mode 0x81a4
jffs2_write_dirent(ino #1, name at *0xc04fa304 "test2"->ino #29, name_crc 0xd5997a45)
jffs2_add_physical_node_ref(): Node at 0x1d0ca4, size 0x30
jffs2_add_fd_to_list( c01f4e60, c0535b4c (->c01f4f20))
jffs2_complete_reservation()
thread_should_wake(): nr_free_blocks 41, nr_erasing_blocks 0, dirty_size 0x1fcfc (mod 0x1fcfc
): no
jffs2_create: Created ino #29 with mode 100644, nlink 1(1)
# ls -l test2
jffs2_readdir() for dir_i #1
Dirent 0: ".", ino #1
Dirent 1: "..", ino #1
jffs2_readdir() for dir_i #1
jffs2_readdir() for dir_i #1
Dirent 0: ".", ino #1
Dirent 1: "..", ino #1
jffs2_readdir() for dir_i #1
jffs2_readdir() for dir_i #1
Dirent 0: ".", ino #1
Dirent 1: "..", ino #1
-rw-r--r--    1 root     root            0 Jan  1 00:04 test2
# rm test2
jffs2_readdir() for dir_i #1
Dirent 0: ".", ino #1
Dirent 1: "..", ino #1
jffs2_readdir() for dir_i #1
jffs2_readdir() for dir_i #1
Dirent 0: ".", ino #1
Dirent 1: "..", ino #1
jffs2_reserve_space(): Requested 0x30 bytes
jffs2_reserve_space(): alloc sem got
jffs2_do_reserve_space(): Giving 0xf32c bytes at 0x1d0cd4
jffs2_write_dirent(ino #1, name at *0xc04fa304 "test2"->ino #0, name_crc 0xd5997a45)
jffs2_add_physical_node_ref(): Node at 0x1d0cd4, size 0x30
jffs2_add_fd_to_list( c01f4920, c0535b4c (->c01f4f20))
Marking old dirent node (ino #29) obsolete
obliterating obsoleted node at 0x001d0ca4
jffs2_complete_reservation()
thread_should_wake(): nr_free_blocks 41, nr_erasing_blocks 0, dirty_size 0x1fd2c (mod 0x1fd2c
): no
# ls -l test2
jffs2_readdir() for dir_i #1
Dirent 0: ".", ino #1
Dirent 1: "..", ino #1
jffs2_readdir() for dir_i #1
jffs2_readdir() for dir_i #1
Dirent 0: ".", ino #1
Dirent 1: "..", ino #1
jffs2_readdir() for dir_i #1
jffs2_readdir() for dir_i #1
Dirent 0: ".", ino #1
Dirent 1: "..", ino #1
jffs2_readdir() for dir_i #1
-rw-r--r--    0 root     root            0 Jan  1 00:04 test2
# 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.infradead.org/pipermail/linux-mtd/attachments/20020702/1cf62c55/attachment.bin 


More information about the linux-mtd mailing list