07bda6
diff -up nfs-utils-2.3.3/utils/mount/nfs.man.save nfs-utils-2.3.3/utils/mount/nfs.man
07bda6
--- nfs-utils-2.3.3/utils/mount/nfs.man.save	2021-07-28 14:42:20.977740892 -0400
07bda6
+++ nfs-utils-2.3.3/utils/mount/nfs.man	2021-07-28 14:42:01.133212815 -0400
07bda6
@@ -525,6 +525,13 @@ using the FS-Cache facility. See cachefi
07bda6
 and <kernel_soruce>/Documentation/filesystems/caching
07bda6
 for detail on how to configure the FS-Cache facility.
07bda6
 Default value is nofsc.
07bda6
+.TP 1.5i
07bda6
+.B sloppy
07bda6
+The
07bda6
+.B sloppy
07bda6
+option is an alternative to specifying
07bda6
+.BR mount.nfs " -s " option.
07bda6
+
07bda6
 .SS "Options for NFS versions 2 and 3 only"
07bda6
 Use these options, along with the options in the above subsection,
07bda6
 for NFS versions 2 and 3 only.
07bda6
diff -up nfs-utils-2.3.3/utils/mount/parse_opt.c.save nfs-utils-2.3.3/utils/mount/parse_opt.c
07bda6
--- nfs-utils-2.3.3/utils/mount/parse_opt.c.save	2021-07-28 14:40:15.467400995 -0400
07bda6
+++ nfs-utils-2.3.3/utils/mount/parse_opt.c	2021-07-28 14:39:57.666927309 -0400
07bda6
@@ -178,6 +178,22 @@ static void options_tail_insert(struct m
07bda6
 	options->count++;
07bda6
 }
07bda6
 
07bda6
+static void options_head_insert(struct mount_options *options,
07bda6
+				struct mount_option *option)
07bda6
+{
07bda6
+	struct mount_option *ohead = options->head;
07bda6
+
07bda6
+	option->prev = NULL;
07bda6
+	option->next = ohead;
07bda6
+	if (ohead)
07bda6
+		ohead->prev = option;
07bda6
+	else
07bda6
+		options->tail = option;
07bda6
+	options->head = option;
07bda6
+
07bda6
+	options->count++;
07bda6
+}
07bda6
+
07bda6
 static void options_delete(struct mount_options *options,
07bda6
 			   struct mount_option *option)
07bda6
 {
07bda6
@@ -374,6 +390,23 @@ po_return_t po_join(struct mount_options
07bda6
 }
07bda6
 
07bda6
 /**
07bda6
+ * po_insert - insert an option into a group of options
07bda6
+ * @options: pointer to mount options
07bda6
+ * @option: pointer to a C string containing the option to add
07bda6
+ *
07bda6
+ */
07bda6
+po_return_t po_insert(struct mount_options *options, char *str)
07bda6
+{
07bda6
+	struct mount_option *option = option_create(str);
07bda6
+
07bda6
+	if (option) {
07bda6
+		options_head_insert(options, option);
07bda6
+		return PO_SUCCEEDED;
07bda6
+	}
07bda6
+	return PO_FAILED;
07bda6
+}
07bda6
+
07bda6
+/**
07bda6
  * po_append - concatenate an option onto a group of options
07bda6
  * @options: pointer to mount options
07bda6
  * @option: pointer to a C string containing the option to add
07bda6
diff -up nfs-utils-2.3.3/utils/mount/parse_opt.h.save nfs-utils-2.3.3/utils/mount/parse_opt.h
07bda6
--- nfs-utils-2.3.3/utils/mount/parse_opt.h.save	2021-07-28 14:40:54.292434148 -0400
07bda6
+++ nfs-utils-2.3.3/utils/mount/parse_opt.h	2021-07-28 14:39:57.666927309 -0400
07bda6
@@ -43,6 +43,7 @@ void			po_replace(struct mount_options *
07bda6
 				   struct mount_options *);
07bda6
 po_return_t		po_join(struct mount_options *, char **);
07bda6
 
07bda6
+po_return_t		po_insert(struct mount_options *, char *);
07bda6
 po_return_t		po_append(struct mount_options *, char *);
07bda6
 po_found_t		po_contains(struct mount_options *, char *);
07bda6
 po_found_t		po_contains_prefix(struct mount_options *options,
07bda6
diff -up nfs-utils-2.3.3/utils/mount/stropts.c.save nfs-utils-2.3.3/utils/mount/stropts.c
07bda6
--- nfs-utils-2.3.3/utils/mount/stropts.c.save	2021-07-28 14:41:14.842981010 -0400
07bda6
+++ nfs-utils-2.3.3/utils/mount/stropts.c	2021-07-28 14:42:01.134212842 -0400
07bda6
@@ -336,13 +336,21 @@ static int nfs_verify_lock_option(struct
07bda6
 	return 1;
07bda6
 }
07bda6
 
07bda6
-static int nfs_append_sloppy_option(struct mount_options *options)
07bda6
+static int nfs_insert_sloppy_option(struct mount_options *options)
07bda6
 {
07bda6
-	if (!sloppy || linux_version_code() < MAKE_VERSION(2, 6, 27))
07bda6
+	if (linux_version_code() < MAKE_VERSION(2, 6, 27))
07bda6
 		return 1;
07bda6
 
07bda6
-	if (po_append(options, "sloppy") == PO_FAILED)
07bda6
-		return 0;
07bda6
+	if (po_contains(options, "sloppy")) {
07bda6
+		po_remove_all(options, "sloppy");
07bda6
+		sloppy++;
07bda6
+	}
07bda6
+
07bda6
+	if (sloppy) {
07bda6
+		if (po_insert(options, "sloppy") == PO_FAILED)
07bda6
+			return 0;
07bda6
+	}
07bda6
+
07bda6
 	return 1;
07bda6
 }
07bda6
 
07bda6
@@ -424,7 +432,7 @@ static int nfs_validate_options(struct n
07bda6
 	if (!nfs_set_version(mi))
07bda6
 		return 0;
07bda6
 
07bda6
-	if (!nfs_append_sloppy_option(mi->options))
07bda6
+	if (!nfs_insert_sloppy_option(mi->options))
07bda6
 		return 0;
07bda6
 
07bda6
 	return 1;