[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

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

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 redhat com>
Cc: stable 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",

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]