On Fri, Jul 09 2010 at 12:27pm -0400, Martin K. Petersen <martin.petersen@xxxxxxxxxx> wrote: > >>>>> "Mike" == Mike Snitzer <snitzer@xxxxxxxxxx> writes: > > Mike> Turns out that this LUN has a 4K granularity requirement (will > Mike> fail the WRITE SAME if the granularity requirements are not met). > > That's lame. The devices I've been working with just ignore the > portions of the block range that are not aligned / do not constitute > entire blocks. What is really lame is this LUN also doesn't have the correct discard_granularity! # cat /sys/block/sda/queue/discard_granularity 512 > I've had the following patch kicking around in my tree for a while. It > does not yet handle offset discard alignment, though. OK, won't help us for this LUN but thanks. I'm left wondering whether the higher level that is discarding a particular large region (say blkdev_issue_discard's loop) should also be trained about discard alignment too. That way the discard requests are submitted properly aligned and they aren't reduced (leaving holes, like your patch could do) -- except for the last discard in a sequence, which could be reduced if its granularity is wrong. No idea if the above will make sense to others ;) Mike -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html