blob: ac39a735ee0b9d92e65af88b1ecbf99dddee7b8f [file] [log] [blame]
From b8c34ff56630b16de94ef5fdb71c495252cbf825 Mon Sep 17 00:00:00 2001
From: David Howells <>
Date: Mon, 9 Dec 2019 15:04:45 +0000
Subject: [PATCH] afs: Fix SELinux setting security label on /afs
commit bcbccaf2edcf1b76f73f890e968babef446151a4 upstream.
Make the AFS dynamic root superblock R/W so that SELinux can set the
security label on it. Without this, upgrades to, say, the Fedora
filesystem-afs RPM fail if afs is mounted on it because the SELinux label
can't be (re-)applied.
It might be better to make it possible to bypass the R/O check for LSM
label application through setxattr.
Fixes: 4d673da14533 ("afs: Support the AFS dynamic root")
Signed-off-by: David Howells <>
Reviewed-by: Marc Dionne <>
Signed-off-by: Paul Gortmaker <>
diff --git a/fs/afs/super.c b/fs/afs/super.c
index f18911e8d770..7129fc868d68 100644
--- a/fs/afs/super.c
+++ b/fs/afs/super.c
@@ -447,7 +447,6 @@ static int afs_fill_super(struct super_block *sb, struct afs_fs_context *ctx)
/* allocate the root inode and dentry */
if (as->dyn_root) {
inode = afs_iget_pseudo_dir(sb, true);
- sb->s_flags |= SB_RDONLY;
} else {
sprintf(sb->s_id, "%llu", as->volume->vid);