>>>>> "Mike" == Mike Snitzer <snitzer@xxxxxxxxxx> writes: Mike, Mike> DM thinp doesn't support partial thinp block discards -- so Mike> misaligned/partial discards are dropped by DM thinp. There isn't Mike> a compelling case for fixing this (by adding a bitset for each Mike> thinp block to support finer grained discards) -- at least not Mike> that I'm aware of. Mike> But I'm missing exactly what it is your helper function would Mike> do... and yet you're asking me what my requirements are.. sorry ;) This came up because the SCSI target would like to support discard_zeroes_data on top of a backing store that has a discard granularity bigger than a logical block. This means that the target code will have to be able to explicitly zero out head and tail ends of a request. Since you have the same "problem" in thinp I was wondering if it would make sense to have a common block layer function for this? Because the discard granularity is a hint I don't like the idea of blkdev_issue_zeroout() having to slice and dice. I really think the decision about what to zero and what to unmap belongs in the entity managing the allocation units. I.e. target or thinp. But that doesn't mean that some of the required logic could not be shared in blk-lib.c. -- Martin K. Petersen Oracle Linux Engineering -- dm-devel mailing list dm-devel@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/dm-devel