[dm-devel] [PATCH] dm-mirror: set discard_zeroes_data_unsupported

Mikulas Patocka mpatocka at redhat.com
Mon Jul 16 23:58:59 UTC 2012


dm-mirror: set discard_zeroes_data_unsupported

We can't guarantee that REQ_DISCARD on dm-mirror zeroes the data even if
the underlying disks support zero on discard.

For example, if the mirror is in the process of resynchronizing, it may
happen that kcopyd reads a piece of data, then discard is sent on the
same area and then kcopyd writes the piece of data to another leg.
Consequently, the data is not zeroed.

So this patch sets ti->discard_zeroes_data_unsupported.

Signed-off-by: Mikulas Patocka <mpatocka at redhat.com>
Cc: stable at kernel.org

---
 drivers/md/dm-raid1.c |    1 +
 1 file changed, 1 insertion(+)

Index: linux-3.5-rc6-fast/drivers/md/dm-raid1.c
===================================================================
--- linux-3.5-rc6-fast.orig/drivers/md/dm-raid1.c	2012-07-17 00:45:34.000000000 +0200
+++ linux-3.5-rc6-fast/drivers/md/dm-raid1.c	2012-07-17 00:45:39.000000000 +0200
@@ -1091,6 +1091,7 @@ static int mirror_ctr(struct dm_target *
 
 	ti->num_flush_requests = 1;
 	ti->num_discard_requests = 1;
+	ti->discard_zeroes_data_unsupported = 1;
 
 	ms->kmirrord_wq = alloc_workqueue("kmirrord",
 					  WQ_NON_REENTRANT | WQ_MEM_RECLAIM, 0);




More information about the dm-devel mailing list