Skip to contentSkip to conversation

CIFS: Deprecating NFS mounting syntax in mount.cifs

PATCH In review [email protected] 1 participant 3 messages Oct 18, 2012 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

The following patch adds a warning when using NFS mounting syntax (server:/share), instead of the usual UNC syntax (//server/share || \\server\share), that support for NFS style mounts will be removed in version 6.0 of the mount.cifs utility.

The reasoning for this is simple. Support for NFS syntax is undocumented and increases maintenance overhead. This came up recently on the cifs-utils list when discussing how to handle mounting a share NFS style using an IPv6 address. Since the ':' character is valid in a POSIX file path or share name it is an ambiguous delimiter. Consider the following valid server share : "dead:beef::1:iSCSIExportedByIQN:storage".

Instead of adding complicated code to the parser to support an undocumented feature, we're optin g to remove the feature in the mount utility in version 6.0 if there is no objection.

#2 lore raw

PATCH 1/1 Add warning that NFS syntax is deprecated and will be removed in cifs-utils-6.0.

In reply to a message not in the archive

From: Scott Lovenberg <[email protected]>

---
 mount.cifs.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
mount.cifs.c +4 -0
index 756fce2..061ce32 100644
@@ -1335,6 +1335,7 @@ static int parse_unc(const char *unc_name, struct parsed_mount_info *parsed_info
 	}
 
 	/* Set up "host" and "share" pointers based on UNC format. */
+	/* TODO: Remove support for NFS syntax as of cifs-utils-6.0. */
 	if (strncmp(unc_name, "//", 2) && strncmp(unc_name, "\\\\", 2)) {
 		/*
 		 * check for nfs syntax (server:/share/prepath)
@@ -1351,6 +1352,9 @@ static int parse_unc(const char *unc_name, struct parsed_mount_info *parsed_info
 		share++;
 		if (*share == '/')
 			++share;
+		fprintf(stderr, "WARNING: using NFS syntax for mounting CIFS "
+			"shares is deprecated and will be removed in cifs-utils"
+			"-6.0. Please migrate to UNC syntax.");
 	} else {
 		host = unc_name + 2;
 		hostlen = strcspn(host, "/\\");
Signature · 1 line
1.7.5.4
#4 lore raw

Re: [PATCH] Add warning that NFS syntax is deprecated and will be removed in cifs-utils-6.0.

In reply to a message not in the archive
Quoted 20 lines · On 10/18/2012 1:50 PM, [email protected]…

From: Scott Lovenberg<[email protected]>

---
  mount.cifs.c |    4 ++++
  1 files changed, 4 insertions(+), 0 deletions(-)
mount.cifs.c +1 -0
index 756fce2..061ce32 100644
@@ -1335,6 +1335,7 @@ static int parse_unc(const char *unc_name, struct parsed_mount_info *parsed_info
  	}
 
  	/* Set up "host" and "share" pointers based on UNC format. */
+	/* TODO: Remove support for NFS syntax as of cifs-utils-6.0. */
  	if (strncmp(unc_name, "//", 2)&&  strncmp(unc_name, "\\\\", 2)) {
  		/*
  		 * check for nfs syntax (server:/share/prepath)

mount.cifs.c static int parse_unc(const char *unc_name, struct parsed_mount_info *parsed_info · line 1360

Quoted 9 lines
mount.cifs.c +3 -0
@@ -1351,6 +1352,9 @@ static int parse_unc(const char *unc_name, struct parsed_mount_info *parsed_info
  		share++;
  		if (*share == '/')
  			++share;
+		fprintf(stderr, "WARNING: using NFS syntax for mounting CIFS "
+			"shares is deprecated and will be removed in cifs-utils"
+			"-6.0. Please migrate to UNC syntax.");
  	} else {
  		host = unc_name + 2;
  		hostlen = strcspn(host, "/\\");

Sorry, git send-email just blew up in my face. It was supposed to send a first email that explained the patch. Of course it worked perfectly when I tested it to my own email address. I'll figure out why the first message is missing and repost. Sorry for the noise.