[PATCH] cifs: add warning messages about change in default uid=/gid= behavior

Jeff Layton jlayton at redhat.com
Fri Jul 31 07:34:26 MDT 2009


Eventually, we'd like to change the meaning of the uid=/gid= options so
that they only specify file ownership when the server does not provide
that information. Changing this abruptly would be considered a regression,
so add a printk that warns about the upcoming change.

To silence the warning, admins can add the appropriate mount options to
clarify their intent when using these options.

Signed-off-by: Jeff Layton <jlayton at redhat.com>
---
 fs/cifs/connect.c |   24 ++++++++++++++++++++----
 1 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 1f3345d..a375356 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -1361,15 +1361,31 @@ cifs_parse_mount_options(char *options, const char *devname,
 	if (vol->UNCip == NULL)
 		vol->UNCip = &vol->UNC[2];
 
-	if (uid_specified)
+	if (uid_specified) {
 		vol->override_uid = override_uid;
-	else if (override_uid == 1)
+		if (override_uid == -1)
+			printk(KERN_WARNING "CIFS: the default behavior when "
+					    "uid= is specified will change in "
+					    "2.6.33 to only specify the owner "
+					    "when the server does not provide "
+					    "one. Add the forceuid or "
+					    "noforceuid options to silence "
+					    "this warning.\n");
+	} else if (override_uid == 1)
 		printk(KERN_NOTICE "CIFS: ignoring forceuid mount option "
 				   "specified with no uid= option.\n");
 
-	if (gid_specified)
+	if (gid_specified) {
 		vol->override_gid = override_gid;
-	else if (override_gid == 1)
+		if (override_gid == -1)
+			printk(KERN_WARNING "CIFS: the default behavior when "
+					    "gid= is specified will change in "
+					    "2.6.33 to only specify the group "
+					    "when the server does not provide "
+					    "one. Add the forcegid or "
+					    "noforcegid options to silence "
+					    "this warning.\n");
+	} else if (override_gid == 1)
 		printk(KERN_NOTICE "CIFS: ignoring forcegid mount option "
 				   "specified with no gid= option.\n");
 
-- 
1.6.0.6


--MP_/+vrxj7YMiqP6Rx3OdEBFNUT
Content-Type: text/x-patch
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename=0001-cifs-update-the-README-with-information-about-uid.patch



More information about the linux-cifs-client mailing list