diff options
author | Jes Sorensen <Jes.Sorensen@gmail.com> | 2017-03-29 20:40:36 +0200 |
---|---|---|
committer | Jes Sorensen <Jes.Sorensen@gmail.com> | 2017-03-29 20:40:36 +0200 |
commit | 5b13d2e1fb8abecddd4e28e67facac5d7ef2cef3 (patch) | |
tree | 7724e4aaf2ec6d71f7696618a66dff199d83a9dc /Incremental.c | |
parent | util: Introduce md_get_array_info() (diff) | |
download | mdadm-5b13d2e1fb8abecddd4e28e67facac5d7ef2cef3.tar.xz mdadm-5b13d2e1fb8abecddd4e28e67facac5d7ef2cef3.zip |
Incremental: Remove redundant call for GET_ARRAY_INFO
The code above just called md_get_array_info() and only reached this
point if it returned an error that isn't ENODEV, so it's pointless to
check this again here.
In addition it was incorrectly retrieving ioctl data into a
mdu_bitmap_file_t instead of mdu_array_info_t.
Fixes: ("8382f19 Add new mode: --incremental")
Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
Diffstat (limited to 'Incremental.c')
-rw-r--r-- | Incremental.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/Incremental.c b/Incremental.c index 1f12c774..802e5255 100644 --- a/Incremental.c +++ b/Incremental.c @@ -1345,7 +1345,6 @@ int IncrementalScan(struct context *c, char *devnm) restart: for (me = mapl ; me ; me = me->next) { mdu_array_info_t array; - mdu_bitmap_file_t bmf; struct mdinfo *sra; int mdfd; @@ -1405,13 +1404,12 @@ restart: * is a hint only */ int added = -1; - if (ioctl(mdfd, GET_ARRAY_INFO, &bmf) < 0) { - int bmfd = open(mddev->bitmap_file, O_RDWR); - if (bmfd >= 0) { - added = ioctl(mdfd, SET_BITMAP_FILE, - bmfd); - close(bmfd); - } + int bmfd; + + bmfd = open(mddev->bitmap_file, O_RDWR); + if (bmfd >= 0) { + added = ioctl(mdfd, SET_BITMAP_FILE, bmfd); + close(bmfd); } if (c->verbose >= 0) { if (added == 0) |