euleros/rtos inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I4LOJ6 CVE: NA
--------------------------------
This patch set introduce many conflicts while backporting mainline bcache patches, revert it temporarily.
This reverts commit e8c75ee9914771ad5dcffaf4ff5716429440dfbc.
Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com --- drivers/md/bcache/request.c | 15 ++++----------- drivers/md/bcache/request.h | 13 ------------- 2 files changed, 4 insertions(+), 24 deletions(-)
diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c index bad70906e8a2..04a779573fdd 100644 --- a/drivers/md/bcache/request.c +++ b/drivers/md/bcache/request.c @@ -735,8 +735,6 @@ struct search *search_alloc(struct bio *bio, /* Count on the bcache device */ s->start_time = part_start_io_acct(d->disk, &s->part, bio); s->prefetch = prefetch; - s->write_inval_data_putoff = false; - s->iop.c = d->c; s->iop.bio = NULL; s->iop.inode = d->id; @@ -757,10 +755,6 @@ static void cached_dev_bio_complete(struct closure *cl) struct search *s = container_of(cl, struct search, cl); struct cached_dev *dc = container_of(s->d, struct cached_dev, disk);
- /* eusure this lock is released after data_insert */ - if (s->write_inval_data_putoff) - up_read_non_owner(&dc->writeback_lock); - cached_dev_put(dc); search_free(cl); } @@ -999,10 +993,10 @@ static void cached_dev_write_complete(struct closure *cl) struct search *s = container_of(cl, struct search, cl); struct cached_dev *dc = container_of(s->d, struct cached_dev, disk);
- if (s->write_inval_data_putoff) + if (!s->iop.bypass) closure_call(&s->iop.cl, bch_data_insert, NULL, cl); - else - up_read_non_owner(&dc->writeback_lock); + + up_read_non_owner(&dc->writeback_lock); continue_at(cl, cached_dev_bio_complete, NULL); }
@@ -1054,7 +1048,6 @@ static void cached_dev_write(struct cached_dev *dc, struct search *s) bio->bi_end_io = backing_request_endio; closure_bio_submit(s->iop.c, bio, cl);
- s->write_inval_data_putoff = true; } else if (s->iop.writeback) { bch_writeback_add(dc); s->iop.bio = bio; @@ -1087,7 +1080,7 @@ static void cached_dev_write(struct cached_dev *dc, struct search *s) }
insert_data: - if (!s->write_inval_data_putoff) + if (!s->iop.bypass) closure_call(&s->iop.cl, bch_data_insert, NULL, cl); continue_at(cl, cached_dev_write_complete, NULL); } diff --git a/drivers/md/bcache/request.h b/drivers/md/bcache/request.h index 42bf280d4625..21678037d215 100644 --- a/drivers/md/bcache/request.h +++ b/drivers/md/bcache/request.h @@ -65,19 +65,6 @@ struct search { unsigned long start_time; /* for prefetch, we do not need copy data to bio */ bool prefetch; - /* - * The function bch_data_insert() is invoked asynchronously as the bio - * subbmited to backend block device, therefore there may be a read - * request subbmited after the bch_data_insert() done and ended before - * the backend bio is end. This read request will read data from the - * backend block device, and insert dirty data to cache device. However - * by writearound cache mode, bcache will not invalidate data again, - * so that read request after will read dirty data from the cache, - * causing a data corruption. - * So that we should put off this invalidation. This switch is for this - * put off. - */ - bool write_inval_data_putoff; struct list_head list_node; wait_queue_head_t wqh; struct acache_info smp;