Revert "hostfs: fix the host directory parse when mounting."

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

This reverts commit be80de30b347dc2eae35dd5f7905ad9c9167dc08 which is
commit ef9ca17ca458ac7253ae71b552e601e49311fc48 upstream.

It is reported to cause build issues and odds are the root problem isn't
really an issue on the 6.6.y branch anyway.  If it is, someone can
provide a working set of backported patches.

Reported-by: Guenter Roeck <linux@xxxxxxxxxxxx>
Link: https://lore.kernel.org/r/cd10a924-ae65-4b02-aea2-e629947ca7a3@xxxxxxxxxxxx
Cc: Hongbo Li <lihongbo22@xxxxxxxxxx>
Cc: Christian Brauner <brauner@xxxxxxxxxx>
Cc: Sasha Levin <sashal@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 fs/hostfs/hostfs_kern.c |   65 +++++++-----------------------------------------
 1 file changed, 10 insertions(+), 55 deletions(-)

--- a/fs/hostfs/hostfs_kern.c
+++ b/fs/hostfs/hostfs_kern.c
@@ -17,7 +17,6 @@
 #include <linux/writeback.h>
 #include <linux/mount.h>
 #include <linux/fs_context.h>
-#include <linux/fs_parser.h>
 #include <linux/namei.h>
 #include "hostfs.h"
 #include <init.h>
@@ -926,6 +925,7 @@ static const struct inode_operations hos
 static int hostfs_fill_super(struct super_block *sb, struct fs_context *fc)
 {
 	struct hostfs_fs_info *fsi = sb->s_fs_info;
+	const char *host_root = fc->source;
 	struct inode *root_inode;
 	int err;
 
@@ -939,6 +939,15 @@ static int hostfs_fill_super(struct supe
 	if (err)
 		return err;
 
+	/* NULL is printed as '(null)' by printf(): avoid that. */
+	if (fc->source == NULL)
+		host_root = "";
+
+	fsi->host_root_path =
+		kasprintf(GFP_KERNEL, "%s/%s", root_ino, host_root);
+	if (fsi->host_root_path == NULL)
+		return -ENOMEM;
+
 	root_inode = hostfs_iget(sb, fsi->host_root_path);
 	if (IS_ERR(root_inode))
 		return PTR_ERR(root_inode);
@@ -964,58 +973,6 @@ static int hostfs_fill_super(struct supe
 	return 0;
 }
 
-enum hostfs_parma {
-	Opt_hostfs,
-};
-
-static const struct fs_parameter_spec hostfs_param_specs[] = {
-	fsparam_string_empty("hostfs",		Opt_hostfs),
-	{}
-};
-
-static int hostfs_parse_param(struct fs_context *fc, struct fs_parameter *param)
-{
-	struct hostfs_fs_info *fsi = fc->s_fs_info;
-	struct fs_parse_result result;
-	char *host_root;
-	int opt;
-
-	opt = fs_parse(fc, hostfs_param_specs, param, &result);
-	if (opt < 0)
-		return opt;
-
-	switch (opt) {
-	case Opt_hostfs:
-		host_root = param->string;
-		if (!*host_root)
-			host_root = "";
-		fsi->host_root_path =
-			kasprintf(GFP_KERNEL, "%s/%s", root_ino, host_root);
-		if (fsi->host_root_path == NULL)
-			return -ENOMEM;
-		break;
-	}
-
-	return 0;
-}
-
-static int hostfs_parse_monolithic(struct fs_context *fc, void *data)
-{
-	struct hostfs_fs_info *fsi = fc->s_fs_info;
-	char *host_root = (char *)data;
-
-	/* NULL is printed as '(null)' by printf(): avoid that. */
-	if (host_root == NULL)
-		host_root = "";
-
-	fsi->host_root_path =
-		kasprintf(GFP_KERNEL, "%s/%s", root_ino, host_root);
-	if (fsi->host_root_path == NULL)
-		return -ENOMEM;
-
-	return 0;
-}
-
 static int hostfs_fc_get_tree(struct fs_context *fc)
 {
 	return get_tree_nodev(fc, hostfs_fill_super);
@@ -1033,8 +990,6 @@ static void hostfs_fc_free(struct fs_con
 }
 
 static const struct fs_context_operations hostfs_context_ops = {
-	.parse_monolithic = hostfs_parse_monolithic,
-	.parse_param	= hostfs_parse_param,
 	.get_tree	= hostfs_fc_get_tree,
 	.free		= hostfs_fc_free,
 };


Patches currently in stable-queue which might be from gregkh@xxxxxxxxxxxxxxxxxxx are

queue-6.6/revert-hostfs-fix-string-handling-in-__dentry_name.patch
queue-6.6/revert-hostfs-convert-hostfs-to-use-the-new-mount-api.patch
queue-6.6/revert-hostfs-fix-the-host-directory-parse-when-mounting.patch
queue-6.6/revert-hostfs-add-const-qualifier-to-host_root-in-hostfs_fill_super.patch




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux