[RFC,v1,4/4] zram: recompression: add ZRAM_MERGED check

Message ID 20221121190020.66548-5-avromanov@sberdevices.ru
State New
Headers
Series Introduce merge identical pages mechanism |

Commit Message

Alexey Romanov Nov. 21, 2022, 7 p.m. UTC
  It is not possible to recompress merged pages in the current
implementation. Although, in the future it is possible to add
support for recompression of merged pages.

Signed-off-by: Alexey Romanov <avromanov@sberdevices.ru>
---
 drivers/block/zram/zram_drv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Patch

diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index 7a267b37e5db..07661283ea15 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -2211,7 +2211,8 @@  static ssize_t recompress_store(struct device *dev,
 		if (zram_test_flag(zram, index, ZRAM_WB) ||
 		    zram_test_flag(zram, index, ZRAM_UNDER_WB) ||
 		    zram_test_flag(zram, index, ZRAM_SAME) ||
-		    zram_test_flag(zram, index, ZRAM_INCOMPRESSIBLE))
+		    zram_test_flag(zram, index, ZRAM_INCOMPRESSIBLE) ||
+		    zram_test_flag(zram, index, ZRAM_MERGED))
 			goto next;
 
 		err = zram_recompress(zram, index, page, threshold,