fsck.vfat hangs after renaming to FSCK9999.REN

Bug #68153 reported by James Baum
6
Affects Status Importance Assigned to Milestone
dosfstools (Ubuntu)
Fix Released
Medium
Onno Benschop

Bug Description

Binary package hint: dosfstools

Running fsck -a /dev/sda1 on a vfat external USB disk with a personality disorder, fsck.vfat hangs after renaming file #9999 to FSCK9999.REN and uses all free CPU time - from top(1):
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
8554 root 25 0 128m 127m 380 R 91.1 12.6 223:23.54 fsck.vfat

It is obviously trying to rename to FSCK(9999+1).REN which doesn't work.

The man page claims that fsck.vfat cvan fix "Directories with a large number of bad entries (probably corrupt). The directory can be dropped.". It would be nice to be able to specify which directory should be dropped as the filesystem crashes when trying rm -rf on this directory. Now fsck crashes too :(

Revision history for this message
Onno Benschop (onno-itmaze) wrote :

Hi, thank you for your bug report.

We've just been trying to reproduce this bug, but couldn't. Is there anything you can tell us about your computer that might give more information. For example:

* Was a specific file, or group of files, involved?
* What names did affected files have?
* Were they all in the same directory, what was the name of that directory?
* How big was the partition that contained the files?
* Which language was the file system?
* Was the file of a particular size?
* Was the file a Windows .lnk file?
* What other symptoms did you notice?

We realise that we're asking lots of questions, but the bug you reported has potentially been identified as being part of a problem tucked away in the internal workings of the operating system and if that is the case, it may affect many users.

Thanks,
Stefan and Onno

Revision history for this message
James Baum (james-baum) wrote :

I'm 99% sure that the problem is that after renaming to FSCK9999.REN fsck.vfat tries to rename a file to FSCK10000.REN. This is not a legal 8+3 dos file name (it's 9+3, not 8+3). This without checking the code. I therefore am worried that your questions are on the wrong track. I'll try and answer anyway:

I'll try and answer but don't have a lot of good answers for several reasons:

The disk was formatted as vfat, I think that was done from a mac (my brothers disk, not mine, I'm just tech-support :-)

The disk in question was an external USB storage, one partition, 250GB. The disk was defect so I sent it in and got my money back. Don't have it anymore, so I can't give exact details, this from memory:

* Was a specific file, or group of files, involved?

Yes, a collection of MP3s

* What names did affected files have?

Typical mp3 file names - Directories with artist, subdirs for album, varying track file names.

* Were they all in the same directory, what was the name of that directory?

No, lots of directories.

* How big was the partition that contained the files?

250GB (whole disk)

* Which language was the file system?

Not sure. Not sure what you mean either? Does vfat support UTF-8? The computers using the disk were using either US english (default) or norwegian (nb_NO.UTF-8 or nb_NO.iso88591, but I'm guessing here)

* Was the file of a particular size?

Typical mp3 file sizes, 2-10MB I guess.

* Was the file a Windows .lnk file?

Probably not, most of them definitely not. It's unlikely that there were any such files, but I'm not 100% sure.

* What other symptoms did you notice?

Nothing special.

Revision history for this message
StefanPotyra (sistpoty) wrote :
Revision history for this message
StefanPotyra (sistpoty) wrote :

Hi,

you're right, when out of names dosfsck simply ends in an infinite loop. The above patch should fix it, though I must admit, that I couldn't test it yet.

Thanks,
    Stefan and Onno.

Revision history for this message
StefanPotyra (sistpoty) wrote :
Revision history for this message
Onno Benschop (onno-itmaze) wrote :

The bug is caused by an out of range error with no checks and was confirmed by looking at the source code.

Changed in dosfstools:
assignee: nobody → onno-itmaze
status: Unconfirmed → Confirmed
Revision history for this message
Daniel T Chen (crimsun) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Tue, 19 Dec 2006 03:20:37 +0100
Source: dosfstools
Binary: dosfstools
Architecture: source
Version: 2.11-2.1ubuntu3
Distribution: feisty
Urgency: low
Maintainer: Roman Hodek <email address hidden>
Changed-By: Stefan Potyra <email address hidden>
Description:
 dosfstools - Utilities to create and check MS-DOS FAT filesystems
Changes:
 dosfstools (2.11-2.1ubuntu3) feisty; urgency=low
 .
   * Fix a hang when dosfsck runs out of names for renamed files.
     - Print an error message instead of doing an infinite loop.
     - Using the file extension for more available names.
     Thanks to Onno Benschop for providing the initial fix.
     Closes: LP#68153.
Files:
 d7e282bbce7f9231a994c0c81f5e6232 573 otherosfs optional dosfstools_2.11-2.1ubuntu3.dsc
 a8a385c9037e63e3e779c9d1ceda090a 10560 otherosfs optional dosfstools_2.11-2.1ubuntu3.diff.gz

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFFh2Dde9GwFciKvaMRAuM3AJ0Vl0kNeJe6adPIvs+YCrSqCwHGlwCfaD+2
D/AQTjidRmpY00WmxZEd+OA=
=wBTt
-----END PGP SIGNATURE-----

Uploading to ubuntu (via ftp to upload.ubuntu.com):
  dosfstools_2.11-2.1ubuntu3.dsc: done.
  dosfstools_2.11-2.1ubuntu3.diff.gz: done.
  dosfstools_2.11-2.1ubuntu3_source.changes: done.
Successfully uploaded packages.

Changed in dosfstools:
importance: Undecided → Medium
status: Confirmed → Fix Committed
Changed in dosfstools:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.