2005-03-12 10:29:56

by Junfeng Yang

[permalink] [raw]
Subject: [CHECKER] crash + fsck cause file systems to contain loops (msdos and vfat, 2.6.11)


Hi,

We are from the Stanford Checker team and are currently developing a file
system checker call FiSC. FiSC mainly focuses on finding crash-recovery
errors. We applied it to FiSC and found a serious error where crash then
recovery cause the file system to contain loops.

To reproduce the warning, download and run our test cases at

http://fisc.stanford.edu/bug7/crash.c (for msdos)
http://fisc.stanford.edu/bug10/crash.c (for vfat)

you can also find the crashed disk images in the corresponding
directories.

We are not sure if these are bugs or not. Your
confirmations/clarifications on this are well appreciated.

-Junfeng


2005-03-12 10:42:05

by Andrew Morton

[permalink] [raw]
Subject: Re: [CHECKER] crash + fsck cause file systems to contain loops (msdos and vfat, 2.6.11)

Junfeng Yang <[email protected]> wrote:
>
> We are from the Stanford Checker team and are currently developing a file
> system checker call FiSC. FiSC mainly focuses on finding crash-recovery
> errors. We applied it to FiSC and found a serious error where crash then
> recovery cause the file system to contain loops.
>
> To reproduce the warning, download and run our test cases at
>
> http://fisc.stanford.edu/bug7/crash.c (for msdos)
> http://fisc.stanford.edu/bug10/crash.c (for vfat)
>
> you can also find the crashed disk images in the corresponding
> directories.
>
> We are not sure if these are bugs or not. Your
> confirmations/clarifications on this are well appreciated.

Linus's current tree includes support for `mount -o sync' on the msdos and
vfat filesystems.

2005-03-12 11:27:53

by Junfeng Yang

[permalink] [raw]
Subject: Re: [CHECKER] crash + fsck cause file systems to contain loops (msdos and vfat, 2.6.11)

> Linus's current tree includes support for `mount -o sync' on the msdos and
> vfat filesystems.

Thanks Andrew. I can just do a bk clone from
http://linux.bkbits.net/linux-2.6 to get Linus's current tree, right?

The warning reported here doesn't need mount -o sync to trigger though.
A simple crash on a default mounted FS can usually cause the FS loop.

(Also, I realized I made many typos in my report --- this implies I'm
tired and should probably get some sleep :)

2005-03-12 14:31:21

by OGAWA Hirofumi

[permalink] [raw]
Subject: Re: [CHECKER] crash + fsck cause file systems to contain loops (msdos and vfat, 2.6.11)

Junfeng Yang <[email protected]> writes:

>> Linus's current tree includes support for `mount -o sync' on the msdos and
>> vfat filesystems.
>
> Thanks Andrew. I can just do a bk clone from
> http://linux.bkbits.net/linux-2.6 to get Linus's current tree, right?
>
> The warning reported here doesn't need mount -o sync to trigger though.
> A simple crash on a default mounted FS can usually cause the FS loop.
>
> (Also, I realized I made many typos in my report --- this implies I'm
> tired and should probably get some sleep :)

Interesting.

$ /devel/linux/works/fatfs/fatfstools/dosfstools-2.10/dosfsck/dosfsck -a bug10/crash.img
dosfsck 2.10, 22 Sep 2003, FAT32, LFN
/0006
Directory does not have any cluster ("." and "..").
Dropping it.
Reclaimed 3 unused clusters (6144 bytes) in 3 chains.
Performing changes.
crash.img: 8 files, 3/8167 clusters

My fixed dosfsck found the above corruption in bug10/crash.img (bug7
has same corruption). And probably you can see root directory via 0006
directory, I guess your testing tree didn't have my patches yet (seems
old behavior).

BTW, what mount options did you use?

Thanks.
--
OGAWA Hirofumi <[email protected]>

2005-03-13 05:54:09

by Junfeng Yang

[permalink] [raw]
Subject: Re: [CHECKER] crash + fsck cause file systems to contain loops (msdos and vfat, 2.6.11)

> Interesting.
>
> $ /devel/linux/works/fatfs/fatfstools/dosfstools-2.10/dosfsck/dosfsck -a bug10/crash.img
> dosfsck 2.10, 22 Sep 2003, FAT32, LFN
> /0006
> Directory does not have any cluster ("." and "..").
> Dropping it.
> Reclaimed 3 unused clusters (6144 bytes) in 3 chains.
> Performing changes.
> crash.img: 8 files, 3/8167 clusters
>
> My fixed dosfsck found the above corruption in bug10/crash.img (bug7
> has same corruption). And probably you can see root directory via 0006
> directory, I guess your testing tree didn't have my patches yet (seems
> old behavior).

I'm using dosfsck 2.10, 22 Sep 2003, FAT32, LFN, and yes, I do see root
directory after I run dosfsck on the crashed disk image. I'm checking
2.6.11. By "your testing tree didn't have my patches yet", you mean you
have the patch but haven't made it public? This "testing tree" is the
Linux source tree? Can you be a little bit more specific?

> BTW, what mount options did you use?

I just used default mount. mount -t msdos source target
no -o

Thanks,
-Junfeng

2005-03-13 11:53:09

by OGAWA Hirofumi

[permalink] [raw]
Subject: Re: [CHECKER] crash + fsck cause file systems to contain loops (msdos and vfat, 2.6.11)

Junfeng Yang <[email protected]> writes:

> I'm using dosfsck 2.10, 22 Sep 2003, FAT32, LFN, and yes,
> I do see root directory after I run dosfsck on the crashed disk
> image.

You can download fixed version of dosfsck at

http://user.parknet.co.jp/hirofumi/tmp/fatfsprogs.tar.bz2

(vanilla dosfsck-2.10 doesn't fix this corruption.)

> I'm checking 2.6.11. By "your testing tree didn't have my
> patches yet", you mean you have the patch but haven't made it
> public?

No. My patches was merged to linus tree at 2 or 3 days ago (merged
after 2.6.11 release). So, I guessed your tree didn't have my patches
yet.

> This "testing tree" is the Linux source tree?

Yes.

Thanks.
--
OGAWA Hirofumi <[email protected]>