diff mbox

[linux-cifs-client] mount.cifs: don't pass text ro/rw options to kernel

Message ID 1245932539-12846-1-git-send-email-jlayton@samba.org (mailing list archive)
State New, archived
Headers show

Commit Message

Jeff Layton June 25, 2009, 12:22 p.m. UTC
/bin/mount strips off the ro/rw options after setting the MS_RDONLY
flag appropriately. Make mount.cifs do the same thing.

Signed-off-by: Jeff Layton <jlayton@samba.org>
---
 client/mount.cifs.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/client/mount.cifs.c b/client/mount.cifs.c
index db05665..4387f59 100644
--- a/client/mount.cifs.c
+++ b/client/mount.cifs.c
@@ -771,8 +771,10 @@  static int parse_options(char ** optionsp, unsigned long * filesys_flags)
 			got_password = 1;
 		} else if (strncmp(data, "ro", 2) == 0) {
 			*filesys_flags |= MS_RDONLY;
+			goto nocopy;
 		} else if (strncmp(data, "rw", 2) == 0) {
 			*filesys_flags &= ~MS_RDONLY;
+			goto nocopy;
                 } else if (strncmp(data, "remount", 7) == 0) {
                         *filesys_flags |= MS_REMOUNT;
 		} /* else if (strnicmp(data, "port", 4) == 0) {