aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Reisner <philipp.reisner@linbit.com>2010-06-29 17:35:34 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2010-08-13 13:30:52 -0700
commitd67a13b5b85e843609aac97965bb576544c0555e (patch)
tree2c86d56161610f9f4c7fde34a10999d1520d4de6
parent8a7da74a3f365faac6d1bb9b7d5a8d65730aefd6 (diff)
downloadlinux-2.6.34-ux500-d67a13b5b85e843609aac97965bb576544c0555e.tar.gz
drbd: Initialize all members of sync_conf to their defaults [Bugz 315]
commit 85f4cc17a62c3ac9edeaf120cdae7261df458053 upstream. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/block/drbd/drbd_main.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 7258c95e895..16ef66a93eb 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -2660,9 +2660,24 @@ static void drbd_unplug_fn(struct request_queue *q)
static void drbd_set_defaults(struct drbd_conf *mdev)
{
- mdev->sync_conf.after = DRBD_AFTER_DEF;
- mdev->sync_conf.rate = DRBD_RATE_DEF;
- mdev->sync_conf.al_extents = DRBD_AL_EXTENTS_DEF;
+ /* This way we get a compile error when sync_conf grows,
+ and we forgot to initialize it here */
+ mdev->sync_conf = (struct syncer_conf) {
+ /* .rate = */ DRBD_RATE_DEF,
+ /* .after = */ DRBD_AFTER_DEF,
+ /* .al_extents = */ DRBD_AL_EXTENTS_DEF,
+ /* .dp_volume = */ DRBD_DP_VOLUME_DEF,
+ /* .dp_interval = */ DRBD_DP_INTERVAL_DEF,
+ /* .throttle_th = */ DRBD_RS_THROTTLE_TH_DEF,
+ /* .hold_off_th = */ DRBD_RS_HOLD_OFF_TH_DEF,
+ /* .verify_alg = */ {}, 0,
+ /* .cpu_mask = */ {}, 0,
+ /* .csums_alg = */ {}, 0,
+ /* .use_rle = */ 0
+ };
+
+ /* Have to use that way, because the layout differs between
+ big endian and little endian */
mdev->state = (union drbd_state) {
{ .role = R_SECONDARY,
.peer = R_UNKNOWN,