All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bug fix for the ntfs driver
@ 2007-08-15 16:26 Bean
  2007-08-20 14:04 ` Marco Gerards
  0 siblings, 1 reply; 5+ messages in thread
From: Bean @ 2007-08-15 16:26 UTC (permalink / raw)
  To: The development of GRUB 2

Hi,

This patch fix a bug in the ntfs driver which occurs when accessing
certain compressed files.

-- 
Bean

2007-08-16  Bean  <bean123ch@gmail.com>

	* fs/ntfs.c (read_block): Bug fix for compressed files.


Index: fs/ntfs.c
===================================================================
RCS file: /sources/grub/grub2/fs/ntfs.c,v
retrieving revision 1.1
diff -u -p -r1.1 ntfs.c
--- fs/ntfs.c	3 Aug 2007 07:44:01 -0000	1.1
+++ fs/ntfs.c	15 Aug 2007 16:15:48 -0000
@@ -665,9 +665,6 @@ read_block (struct grub_ntfs_rlst *ctx,
 	      if (read_run_list (ctx))
 		return grub_errno;
 	    }
-	  if (ctx->target_vcn + 16 < ctx->next_vcn)
-	    return grub_error (GRUB_ERR_BAD_FS,
-			       "Compression block should be 16 sector long");
 	}

       nn = (16 - (ctx->target_vcn & 0xF)) / cpb;
@@ -732,7 +729,9 @@ read_block (struct grub_ntfs_rlst *ctx,
 	      if (buf)
 		{
 		  if (grub_disk_read
-		      (ctx->comp.disk, ctx->curr_lcn * ctx->comp.spc, 0,
+		      (ctx->comp.disk,
+		       (ctx->target_vcn - ctx->curr_vcn +
+			ctx->curr_lcn) * ctx->comp.spc, 0,
 		       nn * (ctx->comp.spc << BLK_SHR), buf))
 		    return grub_errno;
 		  buf += nn * (ctx->comp.spc << BLK_SHR);



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-11-10 20:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-15 16:26 [PATCH] bug fix for the ntfs driver Bean
2007-08-20 14:04 ` Marco Gerards
2007-08-21  2:21   ` Bean
2007-11-10 17:31     ` Marco Gerards
2007-11-10 20:08       ` Robert Millan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.