diff options
author | Tom Cosgrove <tom@cvs.openbsd.org> | 2005-10-08 09:38:23 +0000 |
---|---|---|
committer | Tom Cosgrove <tom@cvs.openbsd.org> | 2005-10-08 09:38:23 +0000 |
commit | e4900f24bd3b7692b98e994b9ca01f3834d39760 (patch) | |
tree | 3a45fca1745f479b54a1def3a4cb5bb6a65be1a4 | |
parent | f4c311c6bc09d7141bb30534956119bf56d27eef (diff) |
When moving a directory to under a new parent, write the correct
cluster number into our . pointer. This fixes filesystem corruption
seen under these circumstances.
Testing nick@, krw@, ian@ and others - thanks.
"i agree" pedro@; "get it in" deraadt@
-rw-r--r-- | sys/msdosfs/msdosfs_vnops.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/msdosfs/msdosfs_vnops.c b/sys/msdosfs/msdosfs_vnops.c index 06378a14060..578a25d23e3 100644 --- a/sys/msdosfs/msdosfs_vnops.c +++ b/sys/msdosfs/msdosfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: msdosfs_vnops.c,v 1.53 2005/03/14 22:31:52 tom Exp $ */ +/* $OpenBSD: msdosfs_vnops.c,v 1.54 2005/10/08 09:38:22 tom Exp $ */ /* $NetBSD: msdosfs_vnops.c,v 1.63 1997/10/17 11:24:19 ws Exp $ */ /*- @@ -1187,7 +1187,7 @@ abortit: goto bad; } dotdotp = (struct direntry *)bp->b_data; - putushort(dotdotp[0].deStartCluster, dp->de_StartCluster); + putushort(dotdotp[0].deStartCluster, cn); pcl = dp->de_StartCluster; if (FAT32(pmp) && pcl == pmp->pm_rootdirblk) pcl = 0; |