rename() on vfat is broken

Oleg Drokin (green@ccssu.ccssu.crimea.ua)
Sat, 5 Dec 1998 14:14:28 +0300 (MSK)


Hello!

Kernel is 2.1.131
I've found that rename on vfat filesystems is broken (someting
strange going on with inoeds, but I failed to find what).
I include log of what I did, to show problem.
Hope that's help.

mordor:~# mount /dos3
MSDOS FS: IO charset koi8-r
MSDOS FS: Using codepage 866
mordor:~# cd /dos3/tmp
mordor:/dos3/tmp#
mordor:/dos3/tmp# ls -li
total 64
11429106 -rw-r--r-- 1 root root 21348 Jul 3 00:37 alarm.tgz
11429107 -rw-r--r-- 1 root root 2667 Jul 1 16:09 gcc.asm
11429108 -rw-r--r-- 1 root root 5031 Jun 30 17:51 jobs.txt
mordor:/dos3/tmp# cp -a gcc.asm 1.txt
mordor:/dos3/tmp# cp -a jobs.txt 2.txt
mordor:/dos3/tmp# ls -li
total 96
11429109 -rw-r--r-- 1 root root 2667 Jul 1 16:09 1.txt
11429110 -rw-r--r-- 1 root root 5031 Jun 30 17:51 2.txt
11429106 -rw-r--r-- 1 root root 21348 Jul 3 00:37 alarm.tgz
11429107 -rw-r--r-- 1 root root 2667 Jul 1 16:09 gcc.asm
11429108 -rw-r--r-- 1 root root 5031 Jun 30 17:51 jobs.txt
mordor:/dos3/tmp# mv 1.txt 11.txt
[If I unmount /dos3 at this point (after any mv at vfat, I mean), I'll get
VFS: Busy inodes after unmount. Self-destruct in 5 seconds. Have a nice day...
]
mordor:/dos3/tmp# ls -li
total 96
11429109 -rw-r--r-- 0 root root 2667 Jul 1 16:09 11.txt
11429110 -rw-r--r-- 1 root root 5031 Jun 30 17:51 2.txt
11429106 -rw-r--r-- 1 root root 21348 Jul 3 00:37 alarm.tgz
11429107 -rw-r--r-- 1 root root 2667 Jul 1 16:09 gcc.asm
11429108 -rw-r--r-- 1 root root 5031 Jun 30 17:51 jobs.txt
mordor:/dos3/tmp# mv 2.txt 21.txt
mordor:/dos3/tmp# ls -li
total 96
11429109 -rw-r--r-- 1 root root 5031 Jun 30 17:51 11.txt
11429110 -rw-r--r-- 0 root root 5031 Jun 30 17:51 21.txt
11429106 -rw-r--r-- 1 root root 21348 Jul 3 00:37 alarm.tgz
11429107 -rw-r--r-- 1 root root 2667 Jul 1 16:09 gcc.asm
11429108 -rw-r--r-- 1 root root 5031 Jun 30 17:51 jobs.txt
mordor:/dos3/tmp# cp alarm.tgz test.tgz
mordor:/dos3/tmp# ls -li
total 144
11429109 -rw-r--r-- 1 root root 5031 Jun 30 17:51 11.txt
11429110 -rw-r--r-- 1 root root 21348 Dec 5 13:55 21.txt
11429106 -rw-r--r-- 1 root root 21348 Jul 3 00:37 alarm.tgz
11429107 -rw-r--r-- 1 root root 2667 Jul 1 16:09 gcc.asm
11429108 -rw-r--r-- 1 root root 5031 Jun 30 17:51 jobs.txt
11429110 -rw-r--r-- 1 root root 21348 Dec 5 13:55 test.tgz
mordor:/dos3/tmp# rm test.tgz
mordor:/dos3/tmp# ls -li
total 96
11429109 -rw-r--r-- 1 root root 5031 Jun 30 17:51 11.txt
11429109 -rw-r--r-- 1 root root 5031 Jun 30 17:51 21.txt
11429106 -rw-r--r-- 1 root root 21348 Jul 3 00:37 alarm.tgz
11429107 -rw-r--r-- 1 root root 2667 Jul 1 16:09 gcc.asm
11429108 -rw-r--r-- 1 root root 5031 Jun 30 17:51 jobs.txt
mordor:/dos3/tmp# rm 11.txt
mordor:/dos3/tmp# ls -l
/bin/ls: 21.txt: No such file or directory
total 64
-rw-r--r-- 1 root root 21348 Jul 3 00:37 alarm.tgz
-rw-r--r-- 1 root root 2667 Jul 1 16:09 gcc.asm
-rw-r--r-- 1 root root 5031 Jun 30 17:51 jobs.txt
mordor:/dos3/tmp# cp -a gcc.asm 1.txt
mordor:/dos3/tmp# mv 1.txt 21.txt
Unable to handle kernel NULL pointer dereference at virtual address 00000022
current->tss.cr3 = 00774000, %cr3 = 00774000
*pde = 00000000
Oops: 0000
CPU: 0
EIP: 0010:[vfat_unlink_free_ino+26/192]
EFLAGS: 00010246
eax: 00ae64f5 ebx: c0b623a0 ecx: c0a10430 edx: 00000000
esi: c08f5400 edi: c07b6ea0 ebp: c0790540 esp: c07b5e54
ds: 0018 es: 0018 ss: 0018
Process mv (pid: 157, process nr: 31, stackpage=c07b5000)
Stack: c0a10430 c0b623a0 c014464c c0a10430 c0790540 c07b6ea0 c0b623a0 00000001
00000000 c0a10430 c07b5ec8 c0b623a0 c08f5400 c07b6ea0 000000c0 00000000
c0144847 c0a10430 c07b5ec8 c07b5ec4 c0b623a0 00000000 00000001 c0b623a0
Call Trace: [vfat_remove_entry+120/220] [vfat_unlinkx+87/132] [vfat_unlink+19/52] [vfat_rename+613/1516] [sys_rename+394/508] [system_call+52/64]
Code: 66 8b 42 22 66 25 00 f0 66 3d 00 80 74 07 83 7c 24 24 00 75

Bye,
Oleg

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/