PATCH: 2.4.0-test1-ac10: micro NTFS bugfix.

From: Anton Altaparmakov (aia21@cam.ac.uk)
Date: Tue Jun 06 2000 - 18:34:18 EST


Alan,

Please apply this NTFS micro patch to the 2.4.0-test1-ac10 kernel. - It
fixes an issue with ntfs_readwrite_attr where a success value was returned
on error, when in fact an error code is the appropriate return. - I
verified the callers of this function and they depend on receiving this
error code otherwise data corruption occurs (this bug is only triggered if
bread returns an error, btw).

Thanks to Rogier Wolff <R.E.Wolff@BitWizard.nl> for pointing this out, but
after looking at it, I am convinced that his suggested fix doesn't cure the
problem so this patch is a modified version.

Also an unused variable that I introduced in the last patch bites the dust
(had forgotten to remove it after making it superfluous).

Regards,

        Anton

diff -ru linux-2.4.0-test1-ac10/fs/ntfs/Makefile linux/fs/ntfs/Makefile
--- linux-2.4.0-test1-ac10/fs/ntfs/Makefile Tue May 2 21:46:53 2000
+++ linux/fs/ntfs/Makefile Tue Jun 6 15:12:11 2000
@@ -3,7 +3,7 @@
 O_TARGET := ntfs.o
 O_OBJS := fs.o sysctl.o support.o util.o inode.o dir.o super.o attr.o
 M_OBJS := $(O_TARGET)
-EXTRA_CFLAGS = -DNTFS_IN_LINUX_KERNEL -DNTFS_VERSION=\"000502\"
+EXTRA_CFLAGS = -DNTFS_IN_LINUX_KERNEL -DNTFS_VERSION=\"000606\"
 
 include $(TOPDIR)/Rules.make
 
diff -ru linux-2.4.0-test1-ac10/fs/ntfs/inode.c linux/fs/ntfs/inode.c
--- linux-2.4.0-test1-ac10/fs/ntfs/inode.c Mon Mar 20 03:10:51 2000
+++ linux/fs/ntfs/inode.c Tue Jun 6 15:12:11 2000
@@ -6,6 +6,7 @@
  * Copyright (C) 1996-1997 Régis Duchesne
  * Copyright (C) 1998 Joseph Malicki
  * Copyright (C) 1999 Steve Dodd
+ * Copyright (C) 2000 Anton Altaparmakov
  */
 
 #include "ntfstypes.h"
@@ -551,11 +552,11 @@
                 dest->size=chunk;
                 error=ntfs_getput_clusters(ino->vol,s_cluster,
                                            offset-s_vcn*clustersize,dest);
- if(error)/* FIXME: maybe return failure */
+ if(error)
                 {
                         ntfs_error("Read error\n");
                         dest->size=copied;
- return 0;
+ return error;
                 }
                 l-=chunk;
                 copied+=chunk;
diff -ru linux-2.4.0-test1-ac10/fs/ntfs/super.c linux/fs/ntfs/super.c
--- linux-2.4.0-test1-ac10/fs/ntfs/super.c Tue May 2 21:46:53 2000
+++ linux/fs/ntfs/super.c Tue Jun 6 15:12:11 2000
@@ -221,7 +221,6 @@
 int ntfs_get_version(ntfs_inode* volume)
 {
         ntfs_attribute *volinfo;
- int i;
 
         volinfo = ntfs_find_attr(volume, volume->vol->at_volume_information, 0);
         if (!volinfo)


--
    "Programmers never die. They do a GOSUB without RETURN." - Unknown source
--
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
ICQ: 8561279
WWW: http://www-stu.christs.cam.ac.uk/~aia21/

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Jun 07 2000 - 21:00:26 EST