From: Werner Almesberger (almesber@nessie.cs.id.ethz.ch)
Date: 10/01/92


From: almesber@nessie.cs.id.ethz.ch (Werner Almesberger)
Subject: Severe MS-DOS FS bug [+ patch] (was Re: MSDOS file system problem)
Date: Fri, 2 Oct 1992 01:11:06 GMT

In article <1a8ce3INNop2@uniwa.uwa.edu.au> toivo@ucs.uwa.OZ.AU (Toivo Pedaste) writes:
> For example, on a floppy
> mkdir a b c d e f g h i j
> mv * a
> will cause a panic.
>
> If I try and mount the disk later it produces
>
> Panic: Fat error

Indeed, that's a bad one ...

It exists (only) in version alpha.8 of the MS-DOS FS and has been
introduced with the link count computation. A patch for it is at
the end of this posting.

Sorry for the inconvenience ...

- Werner

================================== cut here ===================================

*** namei.orig Fri Sep 4 00:05:56 1992
--- namei.c Fri Oct 2 00:51:57 1992
***************
*** 511,521 ****
                    MSDOS_I(new_dir)->i_start;
                dotdot_inode->i_dirt = 1;
                dotdot_bh->b_dirt = 1;
- iput(dotdot_inode);
- brelse(dotdot_bh);
                old_dir->i_nlink--;
                new_dir->i_nlink++;
                /* no need to mark them dirty */
        }
        error = 0;
  rename_done:
--- 511,522 ----
                    MSDOS_I(new_dir)->i_start;
                dotdot_inode->i_dirt = 1;
                dotdot_bh->b_dirt = 1;
                old_dir->i_nlink--;
                new_dir->i_nlink++;
                /* no need to mark them dirty */
+ dotdot_inode->i_nlink = new_dir->i_nlink;
+ iput(dotdot_inode);
+ brelse(dotdot_bh);
        }
        error = 0;
  rename_done:

-- 
   _________________________________________________________________________
  / Werner Almesberger, ETH Zuerich, CH      almesber@nessie.cs.id.ethz.ch /
 / IFW A44  Tel. +41 1 254 7213                 almesberger@rzvax.ethz.ch /
/_BITNET:_ALMESBER@CZHETH5A__HEPNET/CHADNET:_[20579::]57414::ALMESBERGER_/