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>
This commit is contained in:
parent
9cd39f0155
commit
5b13d2e1fb
|
@ -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,14 +1404,13 @@ restart:
|
|||
* is a hint only
|
||||
*/
|
||||
int added = -1;
|
||||
if (ioctl(mdfd, GET_ARRAY_INFO, &bmf) < 0) {
|
||||
int bmfd = open(mddev->bitmap_file, O_RDWR);
|
||||
int bmfd;
|
||||
|
||||
bmfd = open(mddev->bitmap_file, O_RDWR);
|
||||
if (bmfd >= 0) {
|
||||
added = ioctl(mdfd, SET_BITMAP_FILE,
|
||||
bmfd);
|
||||
added = ioctl(mdfd, SET_BITMAP_FILE, bmfd);
|
||||
close(bmfd);
|
||||
}
|
||||
}
|
||||
if (c->verbose >= 0) {
|
||||
if (added == 0)
|
||||
pr_err("Added bitmap %s to %s\n",
|
||||
|
|
Loading…
Reference in New Issue