Skip to contentSkip to conversation

zram: return EBUSY when max_comp_streams change fails for device in use

PATCH NAK Sami Kerola 2 participants 2 messages Aug 3, 2014 – Aug 4, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 zram: return EBUSY when max_comp_streams change fails for device in use

Both disksize and comp_algorithm return EBUSY when a change is attempted to a device in use, and so should max_comp_streams.

---
 drivers/block/zram/zram_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/block/zram/zram_drv.c +1 -1
index 36e54be..0211734 100644
@@ -139,7 +139,7 @@ static ssize_t max_comp_streams_store(struct device *dev,
 	if (init_done(zram)) {
 		if (!zcomp_set_max_streams(zram->comp, num)) {
 			pr_info("Cannot change max compression streams\n");
-			ret = -EINVAL;
+			ret = -EBUSY;
 			goto out;
 		}
 	}
Signature · 1 line
2.0.3
#1 lore raw
Quoted 13 lines · Sami Kerola

Both disksize and comp_algorithm return EBUSY when a change is attempted to a device in use, and so should max_comp_streams.

---
 drivers/block/zram/zram_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/block/zram/zram_drv.c +0 -0
index 36e54be..0211734 100644

drivers/block/zram/zram_drv.c static ssize_t max_comp_streams_store(struct device *dev, · line 145

Quoted 8 lines
drivers/block/zram/zram_drv.c +1 -1
@@ -139,7 +139,7 @@ static ssize_t max_comp_streams_store(struct device *dev,
 	if (init_done(zram)) {
 		if (!zcomp_set_max_streams(zram->comp, num)) {
 			pr_info("Cannot change max compression streams\n");
-			ret = -EINVAL;
+			ret = -EBUSY;
 			goto out;
 		}
 	}

NACK.

failed zcomp_set_max_streams() has nothing to do with device being busy.

	-ss