diff options
author | Adam Kwolek <adam.kwolek@intel.com> | 2011-06-09 13:00:55 +1000 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-06-09 13:00:55 +1000 |
commit | ccced3dc40a25c1bbfb6b998b273d02a9add0795 (patch) | |
tree | b50ba2aff2f5ed0175c50097ade3db0fd5293db8 | |
parent | a6b6d984e037a3424ce20e250d5e84a734ac7e90 (diff) | |
download | mdadm-ccced3dc40a25c1bbfb6b998b273d02a9add0795.tar.gz |
FIX: Move buffer to next location
When no output file is given save_stripes() should collect amount of stripes
in passed buffer. Currently all stripes are saved in the same area in passed
buffer. This causes that last stripe is returned on buffer begin only.
Increase buffer (buf) pointer when save_stripes() is about switch to next
stripe operation. This allows for proper buffer filling as input parameter
length directs.
Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
-rw-r--r-- | restripe.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -652,10 +652,14 @@ int save_stripes(int *source, unsigned long long *offsets, fdisk[0], fdisk[1], bufs); } } - if (dest) + if (dest) { for (i = 0; i < nwrites; i++) if (write(dest[i], buf, len) != len) return -1; + } else { + /* build next stripe in buffer */ + buf += len; + } length -= len; start += len; } |