Messages in this thread Patch in this message | | | Date | Sun, 19 Mar 2000 15:17:44 +0100 (MET) | From | Bo Branten <> | Subject | [PATCH] ntfs, linux-2.3.99-pre1 |
| |
There is an error in the Linux NTFS driver that shows up when reading very large files, very fragmented files or directoryes with many entrys. The patch below fixes the problem and below the patch is an demonstration from my computer before and after the patch.
The credit for finding this solution should go to Artem Khodush arte-@duma.gov.ru, I'm just trying to get it in to the main kernel.
--- fs/ntfs/inode.c.old Thu Jan 20 19:48:35 2000 +++ fs/ntfs/inode.c Sun Mar 19 14:40:55 2000 @@ -258,7 +258,7 @@ if( !buf ) return; delta=0; - for(offset=0;datasize;datasize-=len) + for(offset=0;datasize;datasize-=len,offset+=len) { ntfs_io io; io.fn_put=ntfs_put; @@ -268,7 +268,7 @@
if(ntfs_read_attr(ino,vol->at_attribute_list,0,offset,&io)){ ntfs_error("error in load_attributes\n"); } - delta=len; + delta+=len; parse_attributes(ino,buf,&delta); if(delta) /* move remaining bytes to buffer start */
root@vaino:~# l /mnt/INSTALL/NTWKS40/I386/WOWDEB.EX_ -r-------- 1 root root 48627 Sep 3 1996 /mnt/INSTALL/NTWKS40/I386/WOWDEB.EX_ root@vaino:~# l /mnt/INSTALL/NTWKS40/I386/WOWEXEC.EX_ ?--------- 1 root root 0 Jan 1 1970 /mnt/INSTALL/NTWKS40/I386/WOWEXEC.EX_ root@vaino:~# cp /mnt/INSTALL/NTWKS40/I386/WOWDEB.EX_ /tmp
root@vaino:~# cp /mnt/INSTALL/NTWKS40/I386/WOWEXEC.EX_ /tmp cp: /mnt/INSTALL/NTWKS40/I386/WOWEXEC.EX_: Invalid argument
root@vaino:~# umount /mnt
root@vaino:~# rmmod ntfs
root@vaino:~# insmod /Home/bbn/src/linux/linux-2.3.99-pre1/fs/ntfs/ntfs.o
root@vaino:~# mount -t ntfs -o ro /dev/hda1 /mnt
root@vaino:~# l /mnt/INSTALL/NTWKS40/I386/WOWDEB.EX_ -r-------- 1 root root 1224 Sep 3 1996 /mnt/INSTALL/NTWKS40/I386/WOWDEB.EX_ root@vaino:~# l /mnt/INSTALL/NTWKS40/I386/WOWEXEC.EX_ -r-------- 1 root root 5207 Sep 3 1996 /mnt/INSTALL/NTWKS40/I386/WOWEXEC.EX_ root@vaino:~# cp /mnt/INSTALL/NTWKS40/I386/WOWDEB.EX_ /tmp cp: overwrite `/tmp/WOWDEB.EX_'? y
root@vaino:~# cp /mnt/INSTALL/NTWKS40/I386/WOWEXEC.EX_ /tmp cp: overwrite `/tmp/WOWEXEC.EX_'? y
Bo Branten
- 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/
| |