summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarel Zak2012-02-27 16:43:12 +0100
committerKarel Zak2012-02-27 16:44:38 +0100
commit9bf9690114b7432144caf815e149e35640bc3ad0 (patch)
tree7223f1762704ab4d93eb911b110cc2afe501176e
parentmount: (new) cleanup mount -a return codes (diff)
downloadkernel-qcow2-util-linux-9bf9690114b7432144caf815e149e35640bc3ad0.tar.gz
kernel-qcow2-util-linux-9bf9690114b7432144caf815e149e35640bc3ad0.tar.xz
kernel-qcow2-util-linux-9bf9690114b7432144caf815e149e35640bc3ad0.zip
libmount: use mount.<type> -s for NFS only
Unfortunately, it seems that for example mount.cifs don't care about the API, so we need exception like the original mount(8). Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r--libmount/src/context_mount.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c
index 8cbc25b27..a0c5951c1 100644
--- a/libmount/src/context_mount.c
+++ b/libmount/src/context_mount.c
@@ -369,7 +369,12 @@ static int exec_helper(struct libmnt_context *cxt)
args[i++] = mnt_fs_get_srcpath(cxt->fs);/* 2 */
args[i++] = mnt_fs_get_target(cxt->fs); /* 3 */
- if (mnt_context_is_sloppy(cxt))
+ /*
+ * TODO: remove the exception for "nfs", -s is documented
+ * for years should be usable everywhere.
+ */
+ if (mnt_context_is_sloppy(cxt) &&
+ type && startswith(type, "nfs"))
args[i++] = "-s"; /* 4 */
if (mnt_context_is_fake(cxt))
args[i++] = "-f"; /* 5 */