Skip to content

Commit 3d0e7a9

Browse files
committed
Merge tag 'md/4.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md
Pull MD fixes from Shaohua Li: - Fix a locking issue for md-cluster (Guoqing) - Fix a sync crash for raid10 (Ni) - Fix a reshape bug with raid5 cache enabled (me) * tag 'md/4.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md: md-cluster: release RESYNC lock after the last resync message RAID10 BUG_ON in raise_barrier when force is true and conf->barrier is 0 md/raid5-cache: disable reshape completely
2 parents a12ed06 + 41a9504 commit 3d0e7a9

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

drivers/md/md-cluster.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1276,18 +1276,18 @@ static int resync_info_update(struct mddev *mddev, sector_t lo, sector_t hi)
12761276
static int resync_finish(struct mddev *mddev)
12771277
{
12781278
struct md_cluster_info *cinfo = mddev->cluster_info;
1279+
int ret = 0;
12791280

12801281
clear_bit(MD_RESYNCING_REMOTE, &mddev->recovery);
1281-
dlm_unlock_sync(cinfo->resync_lockres);
12821282

12831283
/*
12841284
* If resync thread is interrupted so we can't say resync is finished,
12851285
* another node will launch resync thread to continue.
12861286
*/
1287-
if (test_bit(MD_CLOSING, &mddev->flags))
1288-
return 0;
1289-
else
1290-
return resync_info_update(mddev, 0, 0);
1287+
if (!test_bit(MD_CLOSING, &mddev->flags))
1288+
ret = resync_info_update(mddev, 0, 0);
1289+
dlm_unlock_sync(cinfo->resync_lockres);
1290+
return ret;
12911291
}
12921292

12931293
static int area_resyncing(struct mddev *mddev, int direction,

drivers/md/raid10.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4529,11 +4529,12 @@ static sector_t reshape_request(struct mddev *mddev, sector_t sector_nr,
45294529
allow_barrier(conf);
45304530
}
45314531

4532+
raise_barrier(conf, 0);
45324533
read_more:
45334534
/* Now schedule reads for blocks from sector_nr to last */
45344535
r10_bio = raid10_alloc_init_r10buf(conf);
45354536
r10_bio->state = 0;
4536-
raise_barrier(conf, sectors_done != 0);
4537+
raise_barrier(conf, 1);
45374538
atomic_set(&r10_bio->remaining, 0);
45384539
r10_bio->mddev = mddev;
45394540
r10_bio->sector = sector_nr;
@@ -4629,6 +4630,8 @@ static sector_t reshape_request(struct mddev *mddev, sector_t sector_nr,
46294630
if (sector_nr <= last)
46304631
goto read_more;
46314632

4633+
lower_barrier(conf);
4634+
46324635
/* Now that we have done the whole section we can
46334636
* update reshape_progress
46344637
*/

drivers/md/raid5-log.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ extern int ppl_modify_log(struct r5conf *conf, struct md_rdev *rdev, bool add);
4646
extern void ppl_quiesce(struct r5conf *conf, int quiesce);
4747
extern int ppl_handle_flush_request(struct r5l_log *log, struct bio *bio);
4848

49+
static inline bool raid5_has_log(struct r5conf *conf)
50+
{
51+
return test_bit(MD_HAS_JOURNAL, &conf->mddev->flags);
52+
}
53+
4954
static inline bool raid5_has_ppl(struct r5conf *conf)
5055
{
5156
return test_bit(MD_HAS_PPL, &conf->mddev->flags);

drivers/md/raid5.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ static bool stripe_can_batch(struct stripe_head *sh)
733733
{
734734
struct r5conf *conf = sh->raid_conf;
735735

736-
if (conf->log || raid5_has_ppl(conf))
736+
if (raid5_has_log(conf) || raid5_has_ppl(conf))
737737
return false;
738738
return test_bit(STRIPE_BATCH_READY, &sh->state) &&
739739
!test_bit(STRIPE_BITMAP_PENDING, &sh->state) &&
@@ -7737,7 +7737,7 @@ static int raid5_resize(struct mddev *mddev, sector_t sectors)
77377737
sector_t newsize;
77387738
struct r5conf *conf = mddev->private;
77397739

7740-
if (conf->log || raid5_has_ppl(conf))
7740+
if (raid5_has_log(conf) || raid5_has_ppl(conf))
77417741
return -EINVAL;
77427742
sectors &= ~((sector_t)conf->chunk_sectors - 1);
77437743
newsize = raid5_size(mddev, sectors, mddev->raid_disks);
@@ -7788,7 +7788,7 @@ static int check_reshape(struct mddev *mddev)
77887788
{
77897789
struct r5conf *conf = mddev->private;
77907790

7791-
if (conf->log || raid5_has_ppl(conf))
7791+
if (raid5_has_log(conf) || raid5_has_ppl(conf))
77927792
return -EINVAL;
77937793
if (mddev->delta_disks == 0 &&
77947794
mddev->new_layout == mddev->layout &&

0 commit comments

Comments
 (0)