Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dm raid: document RAID 4/5/6 discard support

For RAID 4/5/6 data integrity reasons 'discard_zeroes_data' must work
properly.

Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>

authored by

Heinz Mauelshagen and committed by
Mike Snitzer
f15f4d72 bd49784f

+31
+31
Documentation/device-mapper/dm-raid.txt
··· 209 209 "repair" - Initiate a repair of the array. 210 210 "reshape"- Currently unsupported (-EINVAL). 211 211 212 + 213 + Discard Support 214 + --------------- 215 + The implementation of discard support among hardware vendors varies. 216 + When a block is discarded, some storage devices will return zeroes when 217 + the block is read. These devices set the 'discard_zeroes_data' 218 + attribute. Other devices will return random data. Confusingly, some 219 + devices that advertise 'discard_zeroes_data' will not reliably return 220 + zeroes when discarded blocks are read! Since RAID 4/5/6 uses blocks 221 + from a number of devices to calculate parity blocks and (for performance 222 + reasons) relies on 'discard_zeroes_data' being reliable, it is important 223 + that the devices be consistent. Blocks may be discarded in the middle 224 + of a RAID 4/5/6 stripe and if subsequent read results are not 225 + consistent, the parity blocks may be calculated differently at any time; 226 + making the parity blocks useless for redundancy. It is important to 227 + understand how your hardware behaves with discards if you are going to 228 + enable discards with RAID 4/5/6. 229 + 230 + Since the behavior of storage devices is unreliable in this respect, 231 + even when reporting 'discard_zeroes_data', by default RAID 4/5/6 232 + discard support is disabled -- this ensures data integrity at the 233 + expense of losing some performance. 234 + 235 + Storage devices that properly support 'discard_zeroes_data' are 236 + increasingly whitelisted in the kernel and can thus be trusted. 237 + 238 + For trusted devices, the following dm-raid module parameter can be set 239 + to safely enable discard support for RAID 4/5/6: 240 + 'devices_handle_discards_safely' 241 + 242 + 212 243 Version History 213 244 --------------- 214 245 1.0.0 Initial version. Support for RAID 4/5/6