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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'md/3.17-final-fix' of git://neil.brown.name/md

Pull raid5 discard fix from Neil Brown:
"One fix for raid5 discard issue"

* tag 'md/3.17-final-fix' of git://neil.brown.name/md:
md/raid5: disable 'DISCARD' by default due to safety concerns.

+17 -1
+17 -1
drivers/md/raid5.c
··· 64 64 #define cpu_to_group(cpu) cpu_to_node(cpu) 65 65 #define ANY_GROUP NUMA_NO_NODE 66 66 67 + static bool devices_handle_discard_safely = false; 68 + module_param(devices_handle_discard_safely, bool, 0644); 69 + MODULE_PARM_DESC(devices_handle_discard_safely, 70 + "Set to Y if all devices in each array reliably return zeroes on reads from discarded regions"); 67 71 static struct workqueue_struct *raid5_wq; 68 72 /* 69 73 * Stripe cache ··· 6212 6208 mddev->queue->limits.discard_granularity = stripe; 6213 6209 /* 6214 6210 * unaligned part of discard request will be ignored, so can't 6215 - * guarantee discard_zerors_data 6211 + * guarantee discard_zeroes_data 6216 6212 */ 6217 6213 mddev->queue->limits.discard_zeroes_data = 0; 6218 6214 ··· 6237 6233 !bdev_get_queue(rdev->bdev)-> 6238 6234 limits.discard_zeroes_data) 6239 6235 discard_supported = false; 6236 + /* Unfortunately, discard_zeroes_data is not currently 6237 + * a guarantee - just a hint. So we only allow DISCARD 6238 + * if the sysadmin has confirmed that only safe devices 6239 + * are in use by setting a module parameter. 6240 + */ 6241 + if (!devices_handle_discard_safely) { 6242 + if (discard_supported) { 6243 + pr_info("md/raid456: discard support disabled due to uncertainty.\n"); 6244 + pr_info("Set raid456.devices_handle_discard_safely=Y to override.\n"); 6245 + } 6246 + discard_supported = false; 6247 + } 6240 6248 } 6241 6249 6242 6250 if (discard_supported &&