lkml.org 
[lkml]   [2018]   [Dec]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] zram: avoid calling bio_endio() before io complete
Date
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 --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;

--
1.7.9.5
\
 
 \ /
  Last update: 2018-12-20 03:55    [W:0.114 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site