File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 46
46
47
47
static void allow_barrier (struct r1conf * conf , sector_t sector_nr );
48
48
static void lower_barrier (struct r1conf * conf , sector_t sector_nr );
49
+ static void raid1_free (struct mddev * mddev , void * priv );
49
50
50
51
#define RAID_1_10_NAME "raid1"
51
52
#include "raid1-10.c"
@@ -3252,8 +3253,11 @@ static int raid1_run(struct mddev *mddev)
3252
3253
3253
3254
if (!mddev_is_dm (mddev )) {
3254
3255
ret = raid1_set_limits (mddev );
3255
- if (ret )
3256
+ if (ret ) {
3257
+ if (!mddev -> private )
3258
+ raid1_free (mddev , conf );
3256
3259
return ret ;
3260
+ }
3257
3261
}
3258
3262
3259
3263
mddev -> degraded = 0 ;
@@ -3267,6 +3271,8 @@ static int raid1_run(struct mddev *mddev)
3267
3271
*/
3268
3272
if (conf -> raid_disks - mddev -> degraded < 1 ) {
3269
3273
md_unregister_thread (mddev , & conf -> thread );
3274
+ if (!mddev -> private )
3275
+ raid1_free (mddev , conf );
3270
3276
return - EINVAL ;
3271
3277
}
3272
3278
You can’t perform that action at this time.
0 commit comments