On Fri, 25 Sep 2020 11:28:06 +1000, Martin Schwenke <mar...@meltin.net>
wrote:

> I'm sending a patch for an upstream fix...

Patch is attached.

peace & happiness,
martin
>From 97a071f7f1bf5274c027ee92fc0f6ca629ecdd65 Mon Sep 17 00:00:00 2001
From: Martin Schwenke <mar...@meltin.net>
Date: Fri, 25 Sep 2020 11:16:39 +1000
Subject: [PATCH] mount.cifs: ignore comment mount option

mount.cifs currently complains about the "comment" option:

  CIFS: Unknown mount option "comment=foo"

mount(8) on Linux says:

  The command mount does not pass the mount options unbindable,
  runbindable, private, rprivate, slave, rslave, shared, rshared,
  auto, noauto, comment, x-*, loop, offset and sizelimit to the
  mount.<suffix> helpers.

So if mount.cifs decides to re-read /etc/fstab it should ignore the
comment option.

A lot of online posts say to use comment=x-gvfs-show as an option to
have a Linux file manager display a mountpoint for a user mountable
filesystem.  While the "comment=" part is superfluous when combined
with an x-* option, the problem is still difficult to debug.

Signed-off-by: Martin Schwenke <mar...@meltin.net>
---
 mount.cifs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mount.cifs.c b/mount.cifs.c
index 4feb397..5d43c00 100644
--- a/mount.cifs.c
+++ b/mount.cifs.c
@@ -777,6 +777,8 @@ static int parse_opt_token(const char *token)
 		return OPT_BKUPGID;
 	if (strcmp(token, "nofail") == 0)
 		return OPT_NOFAIL;
+	if (strcmp(token, "comment") == 0)
+		return OPT_IGNORE;
 	if (strncmp(token, "x-", 2) == 0)
 		return OPT_IGNORE;
 	if (strncmp(token, "snapshot", 8) == 0)
-- 
2.28.0

Reply via email to