Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-3]: src/sys/fs/msdosfs Pull up following revision(s) (requested b...



details:   https://anonhg.NetBSD.org/src/rev/889081d9a9d8
branches:  netbsd-3
changeset: 577448:889081d9a9d8
user:      tron <tron%NetBSD.org@localhost>
date:      Sun Nov 06 13:32:22 2005 +0000

description:
Pull up following revision(s) (requested by christos in ticket #937):
        sys/fs/msdosfs/denode.h: revision 1.10
        sys/fs/msdosfs/msdosfs_vnops.c: revision 1.22
PR/32003: Brian Buhrow: msdosfs doesn't properly zero out high cluster data
on non-FAT32 msdos filesystems.

diffstat:

 sys/fs/msdosfs/denode.h        |  6 ++++--
 sys/fs/msdosfs/msdosfs_vnops.c |  9 +++++++--
 2 files changed, 11 insertions(+), 4 deletions(-)

diffs (64 lines):

diff -r 09d84cf12574 -r 889081d9a9d8 sys/fs/msdosfs/denode.h
--- a/sys/fs/msdosfs/denode.h   Sun Nov 06 13:31:02 2005 +0000
+++ b/sys/fs/msdosfs/denode.h   Sun Nov 06 13:32:22 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: denode.h,v 1.4.14.2 2005/09/02 15:21:23 riz Exp $      */
+/*     $NetBSD: denode.h,v 1.4.14.3 2005/11/06 13:32:22 tron Exp $     */
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -202,6 +202,8 @@
 
 #define DE_EXTERNALIZE32(dp, dep)                      \
         putushort((dp)->deHighClust, (dep)->de_StartCluster >> 16)
+#define DE_EXTERNALIZE16(dp, dep)                      \
+        putushort((dp)->deHighClust, 0)
 #define DE_EXTERNALIZE(dp, dep)                                \
        (memcpy((dp)->deName, (dep)->de_Name, 11),      \
         (dp)->deAttributes = (dep)->de_Attributes,     \
@@ -214,7 +216,7 @@
         putushort((dp)->deStartCluster, (dep)->de_StartCluster), \
         putulong((dp)->deFileSize,                     \
             ((dep)->de_Attributes & ATTR_DIRECTORY) ? 0 : (dep)->de_FileSize), \
-        (FAT32((dep)->de_pmp) ? DE_EXTERNALIZE32((dp), (dep)) : 0))
+        (FAT32((dep)->de_pmp) ? DE_EXTERNALIZE32((dp), (dep)) : DE_EXTERNALIZE16((dp), (dep))))
 
 #define        de_forw         de_chain[0]
 #define        de_back         de_chain[1]
diff -r 09d84cf12574 -r 889081d9a9d8 sys/fs/msdosfs/msdosfs_vnops.c
--- a/sys/fs/msdosfs/msdosfs_vnops.c    Sun Nov 06 13:31:02 2005 +0000
+++ b/sys/fs/msdosfs/msdosfs_vnops.c    Sun Nov 06 13:32:22 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msdosfs_vnops.c,v 1.14.2.1 2005/09/02 15:21:23 riz Exp $       */
+/*     $NetBSD: msdosfs_vnops.c,v 1.14.2.2 2005/11/06 13:32:22 tron Exp $      */
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_vnops.c,v 1.14.2.1 2005/09/02 15:21:23 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_vnops.c,v 1.14.2.2 2005/11/06 13:32:22 tron Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1146,6 +1146,8 @@
                if (FAT32(pmp)) {
                        putushort(dotdotp->deHighClust,
                                dp->de_StartCluster >> 16);
+               } else {
+                       putushort(dotdotp->deHighClust, 0);
                }
                if ((error = bwrite(bp)) != 0) {
                        /* XXX should really panic here, fs is corrupt */
@@ -1273,6 +1275,9 @@
        if (FAT32(pmp)) {
                putushort(denp[0].deHighClust, newcluster >> 16);
                putushort(denp[1].deHighClust, pdep->de_StartCluster >> 16);
+       } else {
+               putushort(denp[0].deHighClust, 0);
+               putushort(denp[1].deHighClust, 0);
        }
 
        if (async)



Home | Main Index | Thread Index | Old Index