diff options
Diffstat (limited to 'Build.c')
-rw-r--r-- | Build.c | 15 |
1 files changed, 7 insertions, 8 deletions
@@ -75,8 +75,7 @@ int Build(struct mddev_ident *ident, struct mddev_dev *devlist, struct shape *s, /* We need to create the device. It can have no name. */ map_lock(&map); - mdfd = create_mddev(ident->devname, NULL, c->autof, LOCAL, - chosen_name, 0); + mdfd = create_mddev(ident->devname, NULL, LOCAL, chosen_name, 0); if (mdfd < 0) { map_unlock(&map); return 1; @@ -168,13 +167,13 @@ int Build(struct mddev_ident *ident, struct mddev_dev *devlist, struct shape *s, goto abort; } } - if (bitmap_fd >= 0) { - if (ioctl(mdfd, SET_BITMAP_FILE, bitmap_fd) < 0) { - pr_err("Cannot set bitmap file for %s: %s\n", chosen_name, - strerror(errno)); - goto abort; - } + if (ioctl(mdfd, SET_BITMAP_FILE, bitmap_fd) < 0) { + pr_err("Cannot set bitmap file for %s: %s\n", chosen_name, + strerror(errno)); + close(bitmap_fd); + goto abort; } + close(bitmap_fd); } if (ioctl(mdfd, RUN_ARRAY, ¶m)) { pr_err("RUN_ARRAY failed: %s\n", strerror(errno)); |