Bug 2037392

Summary: zram generaor with writeback device - permission denied
Product: [Fedora] Fedora Reporter: Igor Bukanov <igor>
Component: rust-zram-generatorAssignee: Rust SIG <rust-sig>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 35CC: rust-sig, zbyszek
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: rust-zram-generator-1.1.2-1.fc35 rust-zram-generator-1.1.2-1.fc36 rust-zram-generator-1.1.2-1.fc34 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-03-31 01:15:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Igor Bukanov 2022-01-05 14:41:13 UTC
Description of problem:

I tried to setup zram with a writeback device using zram-generator. My config is:

/etc/systemd/zram-generator.conf 
[zram0]
zram-size=24576
compression-algorithm=lz4
writeback-device=/dev/disk/by-label/zram-writeback


But that failed at boot with a permission denied error:


Jan 05 15:11:11 rhea zram-generator[1108]: Error: Failed to configure write-back device into /sys/block/zram0/backing_dev
Jan 05 15:11:11 rhea zram-generator[1108]: Caused by:
Jan 05 15:11:11 rhea zram-generator[1108]:     Permission denied (os error 13)
Jan 05 15:11:11 rhea systemd[1]: systemd-zram-setup: Main process exited, code=exited, status=1/FAILURE
Jan 05 15:11:11 rhea systemd[1]: systemd-zram-setup: Failed with result 'exit-code'.
Jan 05 15:11:11 rhea systemd[1]: Failed to start Create swap on /dev/zram0.
Jan 05 15:11:11 rhea systemd[1]: Dependency failed for Compressed Swap on /dev/zram0.
Jan 05 15:11:11 rhea systemd[1]: dev-zram0.swap: Job dev-zram0.swap/start failed with result 'dependency'.
Jan 05 15:11:11 rhea audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=systemd-zram-setup@zram0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed'


Version-Release number of selected component (if applicable): zram-generator 1.1.1


How reproducible: each boot


Steps to Reproduce:
1. Ensure that a block device is available to serve as zram write back device.
2. Create the above config and restart the system.

Actual results:

Permission denied errors in the log with no zram configured.

Expected results:

zram is configured with a block device.

Comment 1 Igor Bukanov 2022-01-05 17:19:40 UTC
It turned out Fedora kernel is not compiled with the CONFIG_ZRAM_WRITEBACK option. Thus, when zram-generator tries to write to /sys/block/zram0/backing_dev, it got the permission denied error.


Still it will be nice if zram-generator can detect the absence of /sys/block/zramN/backing_dev and report that zram backing is not supported. Currently the error does not even include the name of the file zram-generator ties to write.

Comment 2 Zbigniew Jędrzejewski-Szmek 2022-03-28 08:02:45 UTC
https://github.com/systemd/zram-generator/commit/1ec40215b1

Comment 3 Fedora Update System 2022-03-28 09:35:51 UTC
FEDORA-2022-5e0fef8466 has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-5e0fef8466

Comment 4 Fedora Update System 2022-03-28 09:35:53 UTC
FEDORA-2022-c7f28019a2 has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2022-c7f28019a2

Comment 5 Fedora Update System 2022-03-28 09:35:55 UTC
FEDORA-2022-95003a8fd5 has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2022-95003a8fd5

Comment 6 Fedora Update System 2022-03-29 01:22:38 UTC
FEDORA-2022-5e0fef8466 has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-5e0fef8466`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-5e0fef8466

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 7 Fedora Update System 2022-03-29 01:31:46 UTC
FEDORA-2022-95003a8fd5 has been pushed to the Fedora 35 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-95003a8fd5`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-95003a8fd5

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 8 Fedora Update System 2022-03-29 01:39:21 UTC
FEDORA-2022-c7f28019a2 has been pushed to the Fedora 34 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-c7f28019a2`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-c7f28019a2

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 9 Fedora Update System 2022-03-31 01:15:01 UTC
FEDORA-2022-95003a8fd5 has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 10 Fedora Update System 2022-04-05 00:15:51 UTC
FEDORA-2022-5e0fef8466 has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 11 Fedora Update System 2022-04-13 15:48:45 UTC
FEDORA-2022-c7f28019a2 has been pushed to the Fedora 34 stable repository.
If problem still persists, please make note of it in this bug report.