From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Subject: Re: [PATCH 1/1] determine last ext3 LBA to fix wild LBA reads - v2 From: Benjamin Herrenschmidt To: Doug Maxey In-Reply-To: <32361.1167808666@bebe.enoyolf.org> References: <32361.1167808666@bebe.enoyolf.org> Content-Type: text/plain Date: Thu, 04 Jan 2007 12:09:16 +1100 Message-Id: <1167872956.6165.172.camel@localhost.localdomain> Mime-Version: 1.0 Cc: yaboot-devel@ozlabs.org, Linux PowerPC List List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , > 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.