Skip to content

Commit 9d91f81

Browse files
author
Steve French
committed
cifs: print warning when conflicting soft vs. hard mount options specified
If the user specifies conflicting hard vs. soft mount options (or nosoft vs. nohard) print a warning to dmesg We were missing a warning when a user e.g. mounted with both "hard,soft" mount options. Reviewed-by: Paulo Alcantara (SUSE) <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 2bfd810 commit 9d91f81

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

fs/cifs/fs_context.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -884,16 +884,21 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
884884
ctx->nodfs = 1;
885885
break;
886886
case Opt_hard:
887-
if (result.negated)
887+
if (result.negated) {
888+
if (ctx->retry == 1)
889+
cifs_dbg(VFS, "conflicting hard vs. soft mount options\n");
888890
ctx->retry = 0;
889-
else
891+
} else
890892
ctx->retry = 1;
891893
break;
892894
case Opt_soft:
893895
if (result.negated)
894896
ctx->retry = 1;
895-
else
897+
else {
898+
if (ctx->retry == 1)
899+
cifs_dbg(VFS, "conflicting hard vs soft mount options\n");
896900
ctx->retry = 0;
901+
}
897902
break;
898903
case Opt_mapposix:
899904
if (result.negated)

0 commit comments

Comments
 (0)