From patchwork Mon Feb 7 04:50:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 12736912 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 90ED6C433EF for ; Mon, 7 Feb 2022 06:18:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230083AbiBGGSU (ORCPT ); Mon, 7 Feb 2022 01:18:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231767AbiBGEur (ORCPT ); Sun, 6 Feb 2022 23:50:47 -0500 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBA4EC043181 for ; Sun, 6 Feb 2022 20:50:46 -0800 (PST) Received: by mail-lf1-x12f.google.com with SMTP id n8so24466163lfq.4 for ; Sun, 06 Feb 2022 20:50:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=PQ7+LdtWbkHWKNl9CTBFFg0xqgyq3ew9jM8gttjb63o=; b=BIHggsgchtMJCtkz67QLTwqqJlnDOEdxa1FVL8moLHB18ArJsr/9ZlKOKwxBQKo0Lb f9OvSpCAQ8TuImTKsQ/9dV4SypJLrvdulJhso4IdWC7Nwcc1VICF4u0d018CRoHX8llI yw2G6W1fqkxZlN3v/GpH4aSzKL0sxCYXZSbNUWSBO6nUIp4sQBkMqaBB/5cGmaQzhWM0 29BAtDTO8Iz5u8aWoDV/LPXEMrmRfckWtbpruDrSiBVTGdugCqmLHOSXMOwIdF900DfZ rVi7RBpz2r69QuwOykR6gxzq7T5W1b4O54HYYn29cGGn/B7EsUPpdz1Ya9tcQWh0tdd7 t0Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=PQ7+LdtWbkHWKNl9CTBFFg0xqgyq3ew9jM8gttjb63o=; b=6V4FlBrVe9oVoCiS97sUr1oCFnDKgQmHQhieG3VMfBr6BIQl52bWfivaGF748NEgMJ GS7xMa6F+BkKiT6RoTHBd4aK3zQN7JQG1y4RYPXRrIjVMZPdlB708pqJwzPlFOWYDyRl ntVGptIhurgES9HpR/2YjcHzMLO/ej83pwj4nz72TQ0xkoupCpMlNye0Dpm1Q0tb47PV tup0xvJxHz8IslTp9GeEpbWkVVRSjLy3AQ8S7LAJCOoqMcK9nSELlWz7NqiusBQ2Aow1 Jk5GSTs8/DK4B/zLrLXTuFUT2Ac1MyxSCwyGhR36bUIVxxly2QXz7o0UE7xUOzaEynNh +ucA== X-Gm-Message-State: AOAM533J9OAwlyY80sgRhva08ePxxwyJVklRad62OnRICOAkN79pni1b j8ujMX6EaeFy/LOZFAQaZUTw1sCds8yXUA4NGCkjZSFNgw8= X-Google-Smtp-Source: ABdhPJykm5Y+6IbGiCS/Tj/T+htH6UaNQjF+KQmq/1ngcrOPOimVdV8yqs4UX5a/+4cc9mkCdp/WsHqvaCHhaQd+Qog= X-Received: by 2002:ac2:5df6:: with SMTP id z22mr7242326lfq.601.1644209444646; Sun, 06 Feb 2022 20:50:44 -0800 (PST) MIME-Version: 1.0 From: Steve French Date: Sun, 6 Feb 2022 22:50:33 -0600 Message-ID: Subject: [PATCH][SMB3] improve error message when mount options conflict with posix To: CIFS Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org POSIX extensions require SMB3.1.1 (so improve the error message when vers=3.0, 2.1 or 2.0 is specified on mount) From d0cbe56a7d5ac170f6cf3757ef5a14dd854e7da9 Mon Sep 17 00:00:00 2001 From: Steve French Date: Sun, 6 Feb 2022 18:59:57 -0600 Subject: [PATCH] [smb3] improve error message when mount options conflict with posix POSIX extensions require SMB3.1.1 (so improve the error message when vers=3.0, 2.1 or 2.0 is specified on mount) Signed-off-by: Steve French --- fs/cifs/connect.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 0b742bd50642..cff6c01feae2 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -2340,10 +2340,19 @@ cifs_get_tcon(struct cifs_ses *ses, struct smb3_fs_context *ctx) if (ses->server->posix_ext_supported) { tcon->posix_extensions = true; pr_warn_once("SMB3.11 POSIX Extensions are experimental\n"); - } else { + } else if ((ses->server->vals->protocol_id == SMB311_PROT_ID) || + (strcmp(ses->server->vals->version_string, + SMB3ANY_VERSION_STRING) == 0) || + (strcmp(ses->server->vals->version_string, + SMBDEFAULT_VERSION_STRING) == 0)) { cifs_dbg(VFS, "Server does not support mounting with posix SMB3.11 extensions\n"); rc = -EOPNOTSUPP; goto out_fail; + } else { + cifs_dbg(VFS, "Check vers= mount option. SMB3.11 " + "disabled but required for POSIX extensions\n"); + rc = -EOPNOTSUPP; + goto out_fail; } } -- 2.32.0