]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
zramctl: ignore ENOENT when setting max_comp_streams
authorJiang XueQian <jiangxueqian@gmail.com>
Sat, 30 Aug 2025 09:02:59 +0000 (17:02 +0800)
committerJiang XueQian <jiangxueqian@gmail.com>
Sat, 30 Aug 2025 09:02:59 +0000 (17:02 +0800)
The `max_comp_streams` attribute of zram devices has been deprecated and
all writes were silently ignored by the kernel since 2016. It was
finally removed in 6.15, causing zramctl to fail on ENOENT, when it
should just ignore the error.

Signed-off-by: Jiang XueQian <jiangxueqian@gmail.com>
sys-utils/zramctl.c

index d5bdc2a963ad3d3f263fd61e8aa892d58c5a4009..057e4a3c02ca23f845e24c8cfe84d5b67aa31c13 100644 (file)
@@ -973,7 +973,8 @@ int main(int argc, char **argv)
                        err(EXIT_FAILURE, _("%s: failed to reset"), zram->devname);
 
                if (nstreams &&
-                   zram_set_u64parm(zram, "max_comp_streams", nstreams))
+                   zram_set_u64parm(zram, "max_comp_streams", nstreams) &&
+                   errno != ENOENT)
                        err(EXIT_FAILURE, _("%s: failed to set number of streams"), zram->devname);
 
                if (algorithm &&