aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2023-11-02 16:24:00 +0000
committerDavid Howells <dhowells@redhat.com>2023-11-24 14:52:24 +0000
commit68516f60c1d8b0a71e516d630f66b99cb50e0150 (patch)
treef0076c21694c3f3a0dd8a951e707ed7011b39149
parentb590eb41be766c5a63acc7e8896a042f7a4e8293 (diff)
downloadlibata-68516f60c1d8b0a71e516d630f66b99cb50e0150.tar.gz
afs: Mark a superblock for an R/O or Backup volume as SB_RDONLY
Mark a superblock that is for for an R/O or Backup volume as SB_RDONLY when mounting it. Signed-off-by: David Howells <dhowells@redhat.com> cc: Marc Dionne <marc.dionne@auristor.com> cc: linux-afs@lists.infradead.org
-rw-r--r--fs/afs/super.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/afs/super.c b/fs/afs/super.c
index e95fb4cb4fcd23..a01a0fb2cdbb5c 100644
--- a/fs/afs/super.c
+++ b/fs/afs/super.c
@@ -407,8 +407,10 @@ static int afs_validate_fc(struct fs_context *fc)
return PTR_ERR(volume);
ctx->volume = volume;
- if (volume->type != AFSVL_RWVOL)
+ if (volume->type != AFSVL_RWVOL) {
ctx->flock_mode = afs_flock_mode_local;
+ fc->sb_flags |= SB_RDONLY;
+ }
}
return 0;