Thread (4 messages) flat view 4 messages, 2 authors, 2007-01-04

Re: [PATCH 1/1] determine last ext3 LBA to fix wild LBA reads - v2

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2007-01-04 01:09:16

quoted hunk ↗ jump to hunk
 static errcode_t linux_set_blksize (io_channel channel, int blksize)
 {
+     DEBUG_F("bs set to 0x%x\n", blksize);
      channel->block_size = bs = blksize;
      if (block_buffer) {
 	  free(block_buffer);
@@ -600,6 +612,11 @@ static errcode_t linux_read_blk (io_channel channel, unsigned long block, int co
     
      tempb = (((unsigned long long) block) *
 	      ((unsigned long long)bs)) + (unsigned long long)doff;
+     if (tempb > dend) {
+	  DEBUG_F("\nSeek error on block %lx, tempb=%Lx\n", block, tempb >> 9);
+	  return EXT2_ET_LLSEEK_FAILED;
+     }
+
In the case where we don't pass a "part", dend is 0 no ? We should check
this case and not apply the test...

Ben.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help