2nd PATCH: micro ntfs patch (replaces 1st patch)

From: Anton Altaparmakov (aia21@cam.ac.uk)
Date: Tue Jun 06 2000 - 22:23:14 EST


Alan,

Here is the second attempt at the patch. The first one resulted in braking
expected UNIX behaviour for read (a partial read returned error rather than
the partially read data on first attempt), the possibility of which was
pointed out by Rogier Wolff <R.E.Wolff@BitWizard.nl>.

Please disregard the first patch and apply this one instead. - If you had
applied the first patch already I can send you an incremental patch. - Just
let me know.

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=\"000607\"
 
 include $(TOPDIR)/Rules.make
 
diff -ru linux-2.4.0-test1-ac10/fs/ntfs/fs.c linux/fs/ntfs/fs.c
--- linux-2.4.0-test1-ac10/fs/ntfs/fs.c Mon May 8 21:51:01 2000
+++ linux/fs/ntfs/fs.c Tue Jun 6 18:04:23 2000
@@ -80,7 +80,7 @@
         io.param=buf;
         io.size=count;
         error=ntfs_read_attr(ino,ino->vol->at_data,NULL,*off,&io);
- if(error)return -error;
+ if(error && !io.size)return -error;
         
         *off+=io.size;
         return io.size;
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)


--

"Education is what remains after one has forgotten everything he learned in school." - Albert Einstein

-- Anton Altaparmakov Voice: 01223-333541(lab) / 07712-632205(mobile) Christ's College eMail: AntonA@bigfoot.com Cambridge CB2 3BU ICQ: 8561279 United Kingdom 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:27 EST