aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/ecryptfs/main.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c
index 68954937a071..df217dc9f1d9 100644
--- a/fs/ecryptfs/main.c
+++ b/fs/ecryptfs/main.c
@@ -505,7 +505,6 @@ static struct dentry *ecryptfs_mount(struct file_system_type *fs_type, int flags
505 goto out; 505 goto out;
506 } 506 }
507 507
508 s->s_flags = flags;
509 rc = bdi_setup_and_register(&sbi->bdi, "ecryptfs", BDI_CAP_MAP_COPY); 508 rc = bdi_setup_and_register(&sbi->bdi, "ecryptfs", BDI_CAP_MAP_COPY);
510 if (rc) 509 if (rc)
511 goto out1; 510 goto out1;
@@ -541,6 +540,15 @@ static struct dentry *ecryptfs_mount(struct file_system_type *fs_type, int flags
541 } 540 }
542 541
543 ecryptfs_set_superblock_lower(s, path.dentry->d_sb); 542 ecryptfs_set_superblock_lower(s, path.dentry->d_sb);
543
544 /**
545 * Set the POSIX ACL flag based on whether they're enabled in the lower
546 * mount. Force a read-only eCryptfs mount if the lower mount is ro.
547 * Allow a ro eCryptfs mount even when the lower mount is rw.
548 */
549 s->s_flags = flags & ~MS_POSIXACL;
550 s->s_flags |= path.dentry->d_sb->s_flags & (MS_RDONLY | MS_POSIXACL);
551
544 s->s_maxbytes = path.dentry->d_sb->s_maxbytes; 552 s->s_maxbytes = path.dentry->d_sb->s_maxbytes;
545 s->s_blocksize = path.dentry->d_sb->s_blocksize; 553 s->s_blocksize = path.dentry->d_sb->s_blocksize;
546 s->s_magic = ECRYPTFS_SUPER_MAGIC; 554 s->s_magic = ECRYPTFS_SUPER_MAGIC;