diff mbox series

zram: avoid calling bio_endio() before io complete

Message ID 1545274454-1535-1-git-send-email-huijin.park@samsung.com (mailing list archive)
State New, archived
Headers show
Series zram: avoid calling bio_endio() before io complete | expand

Commit Message

Huijin Park Dec. 20, 2018, 2:54 a.m. UTC
When the bio is given as parameter, zram calls the bio_endio() with
given bio after zram io finished.
However in the case of partial writing, the __zram_bvec_read() calls
the bio_endio() with the given bio regardless of the write operation.
In other words, the bio_endio() may be called at an unwanted time.
So this patch avoids calling bio_endio() with given bio before
writing is completed.

Signed-off-by: Huijin Park <huijin.park@samsung.com>
---
 drivers/block/zram/zram_drv.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index 4879595..b3d3ba2 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -1226,7 +1226,7 @@  static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec,
 		if (!page)
 			return -ENOMEM;
 
-		ret = __zram_bvec_read(zram, page, index, bio, true);
+		ret = __zram_bvec_read(zram, page, index, NULL, true);
 		if (ret)
 			goto out;