2.2.x VFAT/msdos wierdness: bug?

Alexander Stavitsky (stalex@physlab.sci.ccny.cuny.edu)
Sat, 27 Feb 1999 02:41:24 -0500


Hi!

I have observed the following strange effect with 2.2.1 and 2.2.2
(I did not try anything earlier):

If I mount fat partition as vfat and access any of the files which
do not have long names (like the ones created from DOS),
the creation time for those files (they are not supposed to have any)
mysteriously changes by about 8 years into the past.
It happens once per mount/umount cycle irregardless of the number
of times the file has been accessed.
After that Win 95 starts showing erroneous creation time,
although before it was saying "creation time unknown"

Nothing like that was happening with 2.0.x kernels.
Also the files with long names (or at least with vfat entry) are not affected.

It looks to me as if vfat driver creates long name entries for the files
that did not have them and writes erroneous info there.

Here is the account of the events (pretty long):

eagle:/# mount /dev/hda1 /mnt
eagle:/# mount
/dev/hda5 on / type ext2 (rw,errors=remount-ro)
proc on /proc type proc (rw)
/dev/hda7 on /var type ext2 (rw)
/dev/hda8 on /usr type ext2 (rw)
/dev/hda9 on /home type ext2 (rw)
automount(pid171) on /dos type autofs (rw,fd=5,pgrp=171,minproto=2,maxproto=3)
automount(pid182) on /amnt type autofs (rw,fd=5,pgrp=182,minproto=2,maxproto=3)
/dev/hda1 on /mnt type msdos (rw)
eagle:/# ls -l /mnt
total 208
-rwxrwxr-x 1 root root 54645 May 31 1994 command.com
-r-xr-xr-x 1 root root 66294 May 31 1994 drvspace.bin
-r-xr-xr-x 1 root root 40774 May 31 1994 io.sys
-r-xr-xr-x 1 root root 38138 May 31 1994 msdos.sys
eagle:/# ls -lc /mnt
total 208
-rwxrwxr-x 1 root root 54645 May 31 1994 command.com
-r-xr-xr-x 1 root root 66294 May 31 1994 drvspace.bin
-r-xr-xr-x 1 root root 40774 May 31 1994 io.sys
-r-xr-xr-x 1 root root 38138 May 31 1994 msdos.sys
eagle:/# cat /mnt/msdos.sys > /dev/null
eagle:/# ls -lc /mnt
total 208
-rwxrwxr-x 1 root root 54645 May 31 1994 command.com
-r-xr-xr-x 1 root root 66294 May 31 1994 drvspace.bin
-r-xr-xr-x 1 root root 40774 May 31 1994 io.sys
-r-xr-xr-x 1 root root 38138 May 31 1994 msdos.sys
eagle:/# ls -l /mnt
total 208
-rwxrwxr-x 1 root root 54645 May 31 1994 command.com
-r-xr-xr-x 1 root root 66294 May 31 1994 drvspace.bin
-r-xr-xr-x 1 root root 40774 May 31 1994 io.sys
-r-xr-xr-x 1 root root 38138 May 31 1994 msdos.sys
eagle:/# umount /mnt
eagle:/# mount -t msdos /dev/hda1 /mnt
eagle:/# ls -l /mnt
total 208
-rwxrwxr-x 1 root root 54645 May 31 1994 command.com
-r-xr-xr-x 1 root root 66294 May 31 1994 drvspace.bin
-r-xr-xr-x 1 root root 40774 May 31 1994 io.sys
-r-xr-xr-x 1 root root 38138 May 31 1994 msdos.sys
eagle:/# ls -lc /mnt
total 208
-rwxrwxr-x 1 root root 54645 May 31 1994 command.com
-r-xr-xr-x 1 root root 66294 May 31 1994 drvspace.bin
-r-xr-xr-x 1 root root 40774 May 31 1994 io.sys
-r-xr-xr-x 1 root root 38138 May 31 1994 msdos.sys
eagle:/# umount /mnt

----Note: so far filesystem has only been mounted as msdos and
msdos doesn't have creation time, so phony ctime is generated from mtime.
Nothing strange so far.

eagle:/# mount -t vfat /dev/hda1 /mnt
eagle:/# ls -lc /mnt
total 208
-rwxrwxr-x 1 root root 54645 Dec 30 1979 command.com
-r-xr-xr-x 1 root root 66294 Dec 30 1979 drvspace.bin
-r-xr-xr-x 1 root root 38138 Dec 30 1979 msdos.sys
-r-xr-xr-x 1 root root 40774 Nov 24 1971 io.sys
^^^^^^^^^^^^ -This is
due to previous experiments.
There is no creation time for msdos files, so vfat driver
generates "the birth of MS-DOS" time and shows it as ctime.

eagle:/# ls -l /mnt
total 208
-rwxrwxr-x 1 root root 54645 May 31 1994 command.com
-r-xr-xr-x 1 root root 66294 May 31 1994 drvspace.bin
-r-xr-xr-x 1 root root 40774 May 31 1994 io.sys
-r-xr-xr-x 1 root root 38138 May 31 1994 msdos.sys
eagle:/# cat /mnt/msdos.sys > /dev/null
eagle:/# ls -l /mnt
total 208
-rwxrwxr-x 1 root root 54645 May 31 1994 command.com
-r-xr-xr-x 1 root root 66294 May 31 1994 drvspace.bin
-r-xr-xr-x 1 root root 40774 May 31 1994 io.sys
-r-xr-xr-x 1 root root 38138 May 31 1994 msdos.sys
eagle:/# ls -lc /mnt
total 208
-rwxrwxr-x 1 root root 54645 Dec 30 1979 command.com
-r-xr-xr-x 1 root root 66294 Dec 30 1979 drvspace.bin
-r-xr-xr-x 1 root root 38138 Dec 30 1979 msdos.sys
-r-xr-xr-x 1 root root 40774 Nov 24 1971 io.sys
eagle:/# umount /mnt
eagle:/# mount -t vfat /dev/hda1 /mnt
eagle:/# ls -lc /mnt
total 208
-rwxrwxr-x 1 root root 54645 Dec 30 1979 command.com
-r-xr-xr-x 1 root root 66294 Dec 30 1979 drvspace.bin
-r-xr-xr-x 1 root root 40774 Nov 24 1971 io.sys
-r-xr-xr-x 1 root root 38138 Nov 24 1971 msdos.sys
eagle:/#
----- Note: Nov 24 1971 msdos.sys - it has changed.
eagle:/# umount /mnt
eagle:/# mount -t vfat /dev/hda1 /mnt
eagle:/# ls -lc /mnt
total 208
-rwxrwxr-x 1 root root 54645 Dec 30 1979 command.com
-r-xr-xr-x 1 root root 66294 Dec 30 1979 drvspace.bin
-r-xr-xr-x 1 root root 40774 Nov 24 1971 io.sys
-r-xr-xr-x 1 root root 38138 Nov 24 1971 msdos.sys
eagle:/# cat /mnt/msdos.sys > /dev/null
eagle:/# ls -lc /mnt
total 208
-rwxrwxr-x 1 root root 54645 Dec 30 1979 command.com
-r-xr-xr-x 1 root root 66294 Dec 30 1979 drvspace.bin
-r-xr-xr-x 1 root root 40774 Nov 24 1971 io.sys
-r-xr-xr-x 1 root root 38138 Nov 24 1971 msdos.sys
eagle:/# umount /mnt
eagle:/# mount -t vfat /dev/hda1 /mnt
eagle:/# ls -lc /mnt
total 208
-rwxrwxr-x 1 root root 54645 Dec 30 1979 command.com
-r-xr-xr-x 1 root root 66294 Dec 30 1979 drvspace.bin
-r-xr-xr-x 1 root root 40774 Nov 24 1971 io.sys
-r-xr-xr-x 1 root root 38138 Oct 18 1963 msdos.sys
eagle:/#
------------Note: It has changed again.
eagle:/# umount /mnt
eagle:/# mount -t vfat /dev/hda1 /mnt
eagle:/# cat /mnt/msdos.sys > /dev/null
eagle:/# cat /mnt/msdos.sys > /dev/null
eagle:/# cat /mnt/msdos.sys > /dev/null
eagle:/# cat /mnt/msdos.sys > /dev/null
eagle:/# cat /mnt/msdos.sys > /dev/null
eagle:/# umount /mnt
eagle:/# mount -t vfat /dev/hda1 /mnt
eagle:/# ls -lc /mnt
total 208
-rwxrwxr-x 1 root root 54645 Dec 30 1979 command.com
-r-xr-xr-x 1 root root 66294 Dec 30 1979 drvspace.bin
-r-xr-xr-x 1 root root 40774 Nov 24 1971 io.sys
-r-xr-xr-x 1 root root 38138 Sep 12 1955 msdos.sys
eagle:/#

------------- And again. But only by 8 yearsfor each mount/umount cycle.

-
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/