Commit f4bc0c81 authored by Artur Paszkiewicz's avatar Artur Paszkiewicz Committed by Shaohua Li

raid5-ppl: fix handling flush requests

Add missing bio completion. Without this any flush request would hang.

Fixes: 1532d9e8 ("raid5-ppl: PPL support for disks with write-back cache enabled")
Signed-off-by: default avatarArtur Paszkiewicz <artur.paszkiewicz@intel.com>
Signed-off-by: default avatarShaohua Li <sh.li@alibaba-inc.com>
parent 01a69cab
...@@ -44,6 +44,7 @@ extern void ppl_write_stripe_run(struct r5conf *conf); ...@@ -44,6 +44,7 @@ extern void ppl_write_stripe_run(struct r5conf *conf);
extern void ppl_stripe_write_finished(struct stripe_head *sh); extern void ppl_stripe_write_finished(struct stripe_head *sh);
extern int ppl_modify_log(struct r5conf *conf, struct md_rdev *rdev, bool add); extern int ppl_modify_log(struct r5conf *conf, struct md_rdev *rdev, bool add);
extern void ppl_quiesce(struct r5conf *conf, int quiesce); extern void ppl_quiesce(struct r5conf *conf, int quiesce);
extern int ppl_handle_flush_request(struct r5l_log *log, struct bio *bio);
static inline bool raid5_has_ppl(struct r5conf *conf) static inline bool raid5_has_ppl(struct r5conf *conf)
{ {
...@@ -104,7 +105,7 @@ static inline int log_handle_flush_request(struct r5conf *conf, struct bio *bio) ...@@ -104,7 +105,7 @@ static inline int log_handle_flush_request(struct r5conf *conf, struct bio *bio)
if (conf->log) if (conf->log)
ret = r5l_handle_flush_request(conf->log, bio); ret = r5l_handle_flush_request(conf->log, bio);
else if (raid5_has_ppl(conf)) else if (raid5_has_ppl(conf))
ret = 0; ret = ppl_handle_flush_request(conf->log, bio);
return ret; return ret;
} }
......
...@@ -693,6 +693,16 @@ void ppl_quiesce(struct r5conf *conf, int quiesce) ...@@ -693,6 +693,16 @@ void ppl_quiesce(struct r5conf *conf, int quiesce)
} }
} }
int ppl_handle_flush_request(struct r5l_log *log, struct bio *bio)
{
if (bio->bi_iter.bi_size == 0) {
bio_endio(bio);
return 0;
}
bio->bi_opf &= ~REQ_PREFLUSH;
return -EAGAIN;
}
void ppl_stripe_write_finished(struct stripe_head *sh) void ppl_stripe_write_finished(struct stripe_head *sh)
{ {
struct ppl_io_unit *io; struct ppl_io_unit *io;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment