[Intel-gfx] [PATCH 03/22] mm/shmem: parse mount options for MS_KERNMOUNT

Matthew Auld matthew.auld at intel.com
Mon Sep 25 18:47:18 UTC 2017


In i915 we now have our own tmpfs mount, so ensure that shmem_fill_super
also calls shmem_parse_options when dealing with a kernel mount.
Otherwise we have to clumsily call remount_fs when we want to supply our
mount options.

Signed-off-by: Matthew Auld <matthew.auld at intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
Cc: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Dave Hansen <dave.hansen at intel.com>
Cc: Kirill A. Shutemov <kirill at shutemov.name>
Cc: Andrew Morton <akpm at linux-foundation.org>
Cc: Hugh Dickins <hughd at google.com>
Cc: linux-mm at kvack.org
---
 mm/shmem.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/mm/shmem.c b/mm/shmem.c
index ae2e46291ffa..6074e527b9b9 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -3781,13 +3781,15 @@ int shmem_fill_super(struct super_block *sb, void *data, int silent)
 	if (!(sb->s_flags & MS_KERNMOUNT)) {
 		sbinfo->max_blocks = shmem_default_max_blocks();
 		sbinfo->max_inodes = shmem_default_max_inodes();
-		if (shmem_parse_options(data, sbinfo, false)) {
-			err = -EINVAL;
-			goto failed;
-		}
 	} else {
 		sb->s_flags |= MS_NOUSER;
 	}
+
+	if (shmem_parse_options(data, sbinfo, false)) {
+		err = -EINVAL;
+		goto failed;
+	}
+
 	sb->s_export_op = &shmem_export_ops;
 	sb->s_flags |= MS_NOSEC;
 #else
-- 
2.13.5



More information about the Intel-gfx mailing list