All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] restorecon: Only log error on readonly fs (bsc#1257996)
@ 2026-03-10 15:32 Cathy Hu
  2026-04-27 16:52 ` Petr Lautrbach
  0 siblings, 1 reply; 5+ messages in thread
From: Cathy Hu @ 2026-03-10 15:32 UTC (permalink / raw)
  To: selinux; +Cc: Cathy Hu

Signed-off-by: Cathy Hu <cahu@suse.de>
---
RFC Patch for the issue described in thread "Question regarding restorecon and btrfs read-only snapshots"

 libselinux/src/selinux_restorecon.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libselinux/src/selinux_restorecon.c b/libselinux/src/selinux_restorecon.c
index 8fadf4d2..e8545e27 100644
--- a/libselinux/src/selinux_restorecon.c
+++ b/libselinux/src/selinux_restorecon.c
@@ -774,10 +774,14 @@ static int restorecon_sb(const char *pathname, const struct stat *sb,
 		if (!flags->nochange) {
 			if (lsetfilecon(pathname, newcon) < 0) {
 				/* Ignore files removed during relabeling if ignore_noent is set */
-				if (flags->ignore_noent && errno == ENOENT)
+				if (flags->ignore_noent && errno == ENOENT) {
 					goto out;
-				else
+				} else if (errno == EROFS) {
+					selinux_log(SELINUX_INFO, "Read only filesystem, relabel not possible: %s\n", pathname);
+					goto out;
+				} else {
 					goto err;
+				}
 			}
 
 			updated = true;
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-04-30 10:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-10 15:32 [PATCH] restorecon: Only log error on readonly fs (bsc#1257996) Cathy Hu
2026-04-27 16:52 ` Petr Lautrbach
2026-04-28  9:18   ` Cathy Hu
2026-04-28 10:44     ` Petr Lautrbach
2026-04-30 10:58       ` Cathy Hu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.