From 94a20f0c800fd0aa9c26e99750bd2588cae8f038 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Tue, 19 Aug 2008 17:55:15 +1000 Subject: [PATCH] Fix alignment for backup of reshape data. Since we introduced O_DIRECT for device access we need properly aligned buffers and IO requests. The reshape code missed out on the conversion. Signed-off-by: NeilBrown --- Grow.c | 12 ++++++------ restripe.c | 5 +++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Grow.c b/Grow.c index 3a31ea54..14e48f56 100644 --- a/Grow.c +++ b/Grow.c @@ -396,7 +396,8 @@ struct mdp_backup_super { __u64 arraystart; __u64 length; __u32 sb_csum; /* csum of preceeding bytes. */ -}; + __u8 pad[512-68]; +} __attribute__((aligned(512))) bsb; int bsb_csum(char *buf, int len) { @@ -420,7 +421,6 @@ int Grow_reshape(char *devname, int fd, int quiet, char *backup_file, struct mdu_array_info_s array; char *c; - struct mdp_backup_super bsb; struct supertype *st; int nlevel, olevel; @@ -720,7 +720,8 @@ int Grow_reshape(char *devname, int fd, int quiet, char *backup_file, * a leading superblock 4K earlier. */ for (i=array.raid_disks; i sizeof(buf)) len = sizeof(buf); + if (len > 8192) len = 8192; if (len > length) len = length; /* len bytes to be moved from one device */ -- 2.39.2