diff options
author | NeilBrown <neilb@suse.de> | 2008-08-19 17:55:15 +1000 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2008-08-19 17:55:15 +1000 |
commit | 94a20f0c800fd0aa9c26e99750bd2588cae8f038 (patch) | |
tree | d8df647125a5dc530b7489c1e505bece79b9742c /restripe.c | |
parent | e9dd159873cfa0da1ec3e4f173c24f330ea526f8 (diff) | |
download | mdadm-94a20f0c800fd0aa9c26e99750bd2588cae8f038.tar.gz |
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 <neilb@suse.de>
Diffstat (limited to 'restripe.c')
-rw-r--r-- | restripe.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -152,7 +152,8 @@ int save_stripes(int *source, unsigned long long *offsets, int nwrites, int *dest, unsigned long long start, unsigned long long length) { - char buf[8192]; + char abuf[8192+512]; + char *buf = (char*)(((unsigned long)abuf+511)&~511UL); int cpos = start % chunk_size; /* where in chunk we are up to */ int len; int data_disks = raid_disks - (level == 0 ? 0 : level <=5 ? 1 : 2); @@ -162,7 +163,7 @@ int save_stripes(int *source, unsigned long long *offsets, unsigned long long offset; int i; len = chunk_size - cpos; - if (len > sizeof(buf)) len = sizeof(buf); + if (len > 8192) len = 8192; if (len > length) len = length; /* len bytes to be moved from one device */ |