This patch prevents dm-thin from sending discards to shared blocks. It is
an upstream bug, so it should be sent upstream now (preferably before 3.5
comes out).
Mikulas
---
dm-thin: don't send discards to shared blocks
When process_discard receives a partial discard that doesn't cover full
block, it sends this discard down to that block. Unfortunatelly, the
block can be shared and the discard would corrupt the other snapshots
sharing this block.
This patch detects block sharing and ends the discard with sucess when
sending it to the shared block.
The above change causes that if the device supports discard it can't be
guaranteed that a discard request zeroes data. Therefore, we set
ti->discard_zeroes_data_unsupported.