On Mon, 2012-07-16 at 17:02 -0700, Nicholas A. Bellinger wrote: > On Mon, 2012-07-16 at 16:50 -0700, Roland Dreier wrote: > > >> > target: Fix range calculation in WRITE SAME emulation when num blocks > > > > > AFAICT the bug that Patch #2 fixes is a for-next regression, right..? > > > > No, I think the range calculation has been wrong forever. > > (At least my copy of Linus's tree has the bug in target_core_cdb.c) > > > > But I don't think it needs to go to stable really, since the bug > > has been there forever. > > > > In that case I'll get it fixed for-3.5 shortly, and include this into > the -final PULL over the next days. > > Btw, here's the fix i'll be adding (with your signoff) for-3.5 final. diff --git a/drivers/target/target_core_cdb.c b/drivers/target/target_core_cdb.c index 9888693..664f6e7 100644 --- a/drivers/target/target_core_cdb.c +++ b/drivers/target/target_core_cdb.c @@ -1095,7 +1095,7 @@ int target_emulate_write_same(struct se_cmd *cmd) if (num_blocks != 0) range = num_blocks; else - range = (dev->transport->get_blocks(dev) - lba); + range = (dev->transport->get_blocks(dev) - lba) + 1; pr_debug("WRITE_SAME UNMAP: LBA: %llu Range: %llu\n", (unsigned long long)lba, (unsigned long long)range); -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html