ntfs: fix ntfs_read()
authorPaulo Alcantara <pcacjr@gmail.com>
Sun, 28 Aug 2011 21:40:46 +0000 (21:40 +0000)
committerPaulo Alcantara <pcacjr@gmail.com>
Sun, 11 Sep 2011 04:09:59 +0000 (04:09 +0000)
lbytes variable wasn't set correctly.

Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
core/fs/ntfs/ntfs.c

index 82a8f75..51557ee 100644 (file)
@@ -113,7 +113,7 @@ static int ntfs_read(struct fs_info *fs, void *buf, size_t len, uint64_t count,
     if (!offset)
         offset = (*lcn << clust_byte_shift) % blk_size;
 
-    dprintf("lcn:            0x%X\n", *lcn);
+    dprintf("LCN:            0x%X\n", *lcn);
     dprintf("offset:         0x%X\n", offset);
 
     bytes = count;              /* bytes to copy */
@@ -124,8 +124,8 @@ static int ntfs_read(struct fs_info *fs, void *buf, size_t len, uint64_t count,
         loffset = offset;
         offset += count;
     } else {
-        dprintf("bytes:      %u\n", bytes);
-        dprintf("bytes left: %u\n", lbytes);
+        dprintf("bytes:             %u\n", bytes);
+        dprintf("bytes left:        %u\n", lbytes);
         /* otherwise, let's copy it partially... */
         k = 0;
         while (bytes) {
@@ -140,6 +140,7 @@ static int ntfs_read(struct fs_info *fs, void *buf, size_t len, uint64_t count,
                 if (!data)
                     goto out;
 
+                lbytes = bytes;
                 loffset = offset;
                 offset = 0;
             }