Skip to contentSkip to conversation

zram-fix-error-return-codes-not-being-returned-in-writeback_store.patch removed from -mm tree

merged [email protected] 1 participant 1 message Jan 31, 2020

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: drivers/block/zram/zram_drv.c: fix error return codes not being returned in writeback_store
has been removed from the -mm tree. Its filename was
zram-fix-error-return-codes-not-being-returned-in-writeback_store.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Colin Ian King <[email protected]>
Subject: drivers/block/zram/zram_drv.c: fix error return codes not being returned in writeback_store

Currently when an error code -EIO or -ENOSPC in the for-loop of writeback_store the error code is being overwritten by a ret = len assignment at the end of the function and the error codes are being lost. Fix this by assigning ret = len at the start of the function and remove the assignment from the end, hence allowing ret to be preserved when error codes are assigned to it.

Addresses Coverity ("Unused value")

Fixes a939888ec38b ("zram: support idle/huge page writeback")
Cc Sergey Senozhatsky <[email protected]>
Cc Jens Axboe <[email protected]>

---

 drivers/block/zram/zram_drv.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/block/zram/zram_drv.c renamed from drivers/block/zram/zram_drv.c~zram-fix-error-return-codes-not-being-returned-in-writeback_store +1 -2
@@ -629,7 +629,7 @@ static ssize_t writeback_store(struct de
 	struct bio bio;
 	struct bio_vec bio_vec;
 	struct page *page;
-	ssize_t ret;
+	ssize_t ret = len;
 	int mode;
 	unsigned long blk_idx = 0;
 
@@ -765,7 +765,6 @@ next:
 
 	if (blk_idx)
 		free_block_bdev(zram, blk_idx);
-	ret = len;
 	__free_page(page);
 release_init_lock:
 	up_read(&zram->init_lock);

_

Patches currently in -mm which might be from [email protected] are