diff options
author | Artur Paszkiewicz <artur.paszkiewicz@intel.com> | 2018-02-20 04:10:36 -0500 |
---|---|---|
committer | Shaohua Li <sh.li@alibaba-inc.com> | 2018-02-21 12:40:40 -0500 |
commit | f4bc0c813e03bdb93f5300c3e06d7a0f07f65a74 (patch) | |
tree | 2ea6fafb1c885f995140e16e052c4c8b83d3b2d0 | |
parent | 01a69cab01c184d3786af09e9339311123d63d22 (diff) |
raid5-ppl: fix handling flush requests
Add missing bio completion. Without this any flush request would hang.
Fixes: 1532d9e87e8b ("raid5-ppl: PPL support for disks with write-back cache enabled")
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Signed-off-by: Shaohua Li <sh.li@alibaba-inc.com>
-rw-r--r-- | drivers/md/raid5-log.h | 3 | ||||
-rw-r--r-- | drivers/md/raid5-ppl.c | 10 |
2 files changed, 12 insertions, 1 deletions
diff --git a/drivers/md/raid5-log.h b/drivers/md/raid5-log.h index 0c76bcedfc1c..a001808a2b77 100644 --- a/drivers/md/raid5-log.h +++ b/drivers/md/raid5-log.h | |||
@@ -44,6 +44,7 @@ extern void ppl_write_stripe_run(struct r5conf *conf); | |||
44 | extern void ppl_stripe_write_finished(struct stripe_head *sh); | 44 | extern void ppl_stripe_write_finished(struct stripe_head *sh); |
45 | extern int ppl_modify_log(struct r5conf *conf, struct md_rdev *rdev, bool add); | 45 | extern int ppl_modify_log(struct r5conf *conf, struct md_rdev *rdev, bool add); |
46 | extern void ppl_quiesce(struct r5conf *conf, int quiesce); | 46 | extern void ppl_quiesce(struct r5conf *conf, int quiesce); |
47 | extern int ppl_handle_flush_request(struct r5l_log *log, struct bio *bio); | ||
47 | 48 | ||
48 | static inline bool raid5_has_ppl(struct r5conf *conf) | 49 | static inline bool raid5_has_ppl(struct r5conf *conf) |
49 | { | 50 | { |
@@ -104,7 +105,7 @@ static inline int log_handle_flush_request(struct r5conf *conf, struct bio *bio) | |||
104 | if (conf->log) | 105 | if (conf->log) |
105 | ret = r5l_handle_flush_request(conf->log, bio); | 106 | ret = r5l_handle_flush_request(conf->log, bio); |
106 | else if (raid5_has_ppl(conf)) | 107 | else if (raid5_has_ppl(conf)) |
107 | ret = 0; | 108 | ret = ppl_handle_flush_request(conf->log, bio); |
108 | 109 | ||
109 | return ret; | 110 | return ret; |
110 | } | 111 | } |
diff --git a/drivers/md/raid5-ppl.c b/drivers/md/raid5-ppl.c index 2764c2290062..42890a08375b 100644 --- a/drivers/md/raid5-ppl.c +++ b/drivers/md/raid5-ppl.c | |||
@@ -693,6 +693,16 @@ void ppl_quiesce(struct r5conf *conf, int quiesce) | |||
693 | } | 693 | } |
694 | } | 694 | } |
695 | 695 | ||
696 | int ppl_handle_flush_request(struct r5l_log *log, struct bio *bio) | ||
697 | { | ||
698 | if (bio->bi_iter.bi_size == 0) { | ||
699 | bio_endio(bio); | ||
700 | return 0; | ||
701 | } | ||
702 | bio->bi_opf &= ~REQ_PREFLUSH; | ||
703 | return -EAGAIN; | ||
704 | } | ||
705 | |||
696 | void ppl_stripe_write_finished(struct stripe_head *sh) | 706 | void ppl_stripe_write_finished(struct stripe_head *sh) |
697 | { | 707 | { |
698 | struct ppl_io_unit *io; | 708 | struct ppl_io_unit *io; |