Home Home > GIT Browse > vanilla
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2017-04-29 21:27:23 +0200
committerTakashi Iwai <tiwai@suse.de>2017-04-29 21:27:23 +0200
commit247968fead9f108a80491f3a2c3a120369bfd133 (patch)
tree8ddc938e91b85bd0dfc7daa40090e00beb51e288
parent97b2583074b76300758aa132f8369b9272259049 (diff)
parent69acef1e725405698e0ee8c187f371f558255b2e (diff)
Merge branch 'users/colyli/SLE12-SP3/for-sp3-next' into SLE12-SP3rpm-4.4.63-1
Pull MD fixes from Coly Li (bsc#1036950). suse-commit: da2fdcbb2b2b7d34fc3f0915e2270db4ae65b052
-rw-r--r--drivers/md/md.h7
-rw-r--r--drivers/md/raid0.c3
-rw-r--r--drivers/md/raid1.c16
-rw-r--r--drivers/md/raid1.h1
-rw-r--r--drivers/md/raid10.c8
-rw-r--r--drivers/md/raid5-log.h2
-rw-r--r--drivers/md/raid5.c9
-rw-r--r--drivers/md/raid5.h10
8 files changed, 21 insertions, 35 deletions
diff --git a/drivers/md/md.h b/drivers/md/md.h
index 168136c15e40..67a9de22e636 100644
--- a/drivers/md/md.h
+++ b/drivers/md/md.h
@@ -179,11 +179,6 @@ enum flag_bits {
* Usually, this device should be faster
* than other devices in the array
*/
- RemoveSynchronised, /* synchronize_rcu was called after
- * This device was known to be faulty,
- * so it is save to remove without
- * another call.
- */
ClusterRemove,
RemoveSynchronized, /* synchronize_rcu() was called after
* this device was known to be faulty,
@@ -203,7 +198,6 @@ enum flag_bits {
* it didn't fail, so don't use FailFast
* any more for metadata
*/
- MD_HAS_PPL, /* The raid array has PPL feature set */
};
static inline int is_badblock(struct md_rdev *rdev, sector_t s, int sectors,
@@ -239,6 +233,7 @@ enum mddev_flags {
* supported as calls to md_error() will
* never cause the array to become failed.
*/
+ MD_HAS_PPL, /* The raid array has PPL feature set */
};
enum mddev_sb_flags {
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
index 47357d9b9c09..e777e48f55f6 100644
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@ -29,7 +29,8 @@
#define UNSUPPORTED_MDDEV_FLAGS \
((1L << MD_HAS_JOURNAL) | \
(1L << MD_JOURNAL_CLEAN) | \
- (1L << MD_FAILFAST_SUPPORTED))
+ (1L << MD_FAILFAST_SUPPORTED) |\
+ (1L << MD_HAS_PPL))
static int raid0_congested(struct mddev *mddev, int bits)
{
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 447c0c8fe93d..26c882b2831e 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -44,7 +44,8 @@
#define UNSUPPORTED_MDDEV_FLAGS \
((1L << MD_HAS_JOURNAL) | \
- (1L << MD_JOURNAL_CLEAN))
+ (1L << MD_JOURNAL_CLEAN) | \
+ (1L << MD_HAS_PPL))
/*
* Number of guaranteed r1bios in case of extreme VM load:
@@ -881,7 +882,7 @@ static void raise_barrier(struct r1conf *conf, sector_t sector_nr)
atomic_read(&conf->barrier[idx]) < RESYNC_DEPTH,
conf->resync_lock);
- atomic_inc(&conf->nr_pending[idx]);
+ atomic_inc(&conf->nr_sync_pending);
spin_unlock_irq(&conf->resync_lock);
}
@@ -892,7 +893,7 @@ static void lower_barrier(struct r1conf *conf, sector_t sector_nr)
BUG_ON(atomic_read(&conf->barrier[idx]) <= 0);
atomic_dec(&conf->barrier[idx]);
- atomic_dec(&conf->nr_pending[idx]);
+ atomic_dec(&conf->nr_sync_pending);
wake_up(&conf->wait_barrier);
}
@@ -1029,7 +1030,8 @@ static int get_unqueued_pending(struct r1conf *conf)
{
int idx, ret;
- for (ret = 0, idx = 0; idx < BARRIER_BUCKETS_NR; idx++)
+ ret = atomic_read(&conf->nr_sync_pending);
+ for (idx = 0; idx < BARRIER_BUCKETS_NR; idx++)
ret += atomic_read(&conf->nr_pending[idx]) -
atomic_read(&conf->nr_queued[idx]);
@@ -1827,9 +1829,9 @@ static int raid1_remove_disk(struct mddev *mddev, struct md_rdev *rdev)
p->rdev = repl;
conf->mirrors[conf->raid_disks + number].rdev = NULL;
unfreeze_array(conf);
- clear_bit(WantReplacement, &rdev->flags);
- } else
- clear_bit(WantReplacement, &rdev->flags);
+ }
+
+ clear_bit(WantReplacement, &rdev->flags);
err = md_integrity_register(mddev);
}
abort:
diff --git a/drivers/md/raid1.h b/drivers/md/raid1.h
index b0ab0da6e39e..c8894ef1e9d2 100644
--- a/drivers/md/raid1.h
+++ b/drivers/md/raid1.h
@@ -84,6 +84,7 @@ struct r1conf {
*/
wait_queue_head_t wait_barrier;
spinlock_t resync_lock;
+ atomic_t nr_sync_pending;
atomic_t *nr_pending;
atomic_t *nr_waiting;
atomic_t *nr_queued;
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 83e502b8c138..b4713fa5b5b4 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -1878,13 +1878,9 @@ static int raid10_remove_disk(struct mddev *mddev, struct md_rdev *rdev)
* but will never see neither -- if they are careful.
*/
p->replacement = NULL;
- clear_bit(WantReplacement, &rdev->flags);
- } else
- /* We might have just remove the Replacement as faulty
- * Clear the flag just in case
- */
- clear_bit(WantReplacement, &rdev->flags);
+ }
+ clear_bit(WantReplacement, &rdev->flags);
err = md_integrity_register(mddev);
abort:
diff --git a/drivers/md/raid5-log.h b/drivers/md/raid5-log.h
index 20f1f7c8c57b..27097101ccca 100644
--- a/drivers/md/raid5-log.h
+++ b/drivers/md/raid5-log.h
@@ -33,7 +33,7 @@ extern bool r5c_big_stripe_cached(struct r5conf *conf, sector_t sect);
extern struct dma_async_tx_descriptor *
ops_run_partial_parity(struct stripe_head *sh, struct raid5_percpu *percpu,
- struct dma_async_tx_descriptor *tx);
+ struct dma_async_tx_descriptor *tx);
extern int ppl_init_log(struct r5conf *conf);
extern void ppl_exit_log(struct r5conf *conf);
extern int ppl_write_stripe(struct r5conf *conf, struct stripe_head *sh);
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 7dd8fb00dbc0..e7349d6e04bb 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -7639,15 +7639,12 @@ static int raid5_remove_disk(struct mddev *mddev, struct md_rdev *rdev)
* but will never see neither - if they are careful
*/
p->replacement = NULL;
- clear_bit(WantReplacement, &rdev->flags);
if (!err)
err = log_modify(conf, p->rdev, true);
- } else
- /* We might have just removed the Replacement as faulty-
- * clear the bit just in case
- */
- clear_bit(WantReplacement, &rdev->flags);
+ }
+
+ clear_bit(WantReplacement, &rdev->flags);
abort:
print_raid5_conf(conf);
diff --git a/drivers/md/raid5.h b/drivers/md/raid5.h
index 088afc764301..dcb7d18ba897 100644
--- a/drivers/md/raid5.h
+++ b/drivers/md/raid5.h
@@ -230,10 +230,10 @@ struct stripe_head {
};
struct list_head log_list;
-
- struct page *ppl_page; /* partial parity of this stripe */
sector_t log_start; /* first meta block on the journal */
struct list_head r5c; /* for r5c_cache->stripe_in_journal */
+
+ struct page *ppl_page; /* partial parity of this stripe */
/**
* struct stripe_operations
* @target - STRIPE_OP_COMPUTE_BLK target
@@ -487,12 +487,6 @@ static inline struct bio *r5_next_bio(struct bio *bio, sector_t sector)
return NULL;
}
-#define NR_STRIPES 256
-#define STRIPE_SIZE PAGE_SIZE
-#define STRIPE_SHIFT (PAGE_SHIFT - 9)
-#define STRIPE_SECTORS (STRIPE_SIZE>>9)
-
-
/* NOTE NR_STRIPE_HASH_LOCKS must remain below 64.
* This is because we sometimes take all the spinlocks
* and creating that much locking depth can cause