From patchwork Wed Jun 3 04:21:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 11584961 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DCF861391 for ; Wed, 3 Jun 2020 04:21:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B68322072F for ; Wed, 3 Jun 2020 04:21:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bMFid17N" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725792AbgFCEVT (ORCPT ); Wed, 3 Jun 2020 00:21:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725275AbgFCEVS (ORCPT ); Wed, 3 Jun 2020 00:21:18 -0400 Received: from mail-yb1-xb31.google.com (mail-yb1-xb31.google.com [IPv6:2607:f8b0:4864:20::b31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6688C05BD43 for ; Tue, 2 Jun 2020 21:21:18 -0700 (PDT) Received: by mail-yb1-xb31.google.com with SMTP id a80so372532ybg.1 for ; Tue, 02 Jun 2020 21:21:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=slh6yBO0jWz0DFWzHcd2paEGLCk5s4IJ70Q+yDxTFuY=; b=bMFid17NMYrWYE/NLMGsWkaEjn7aZtOlw5JAN3hzqOvpcSTrG4xEl7syjPVKayw/ME 9ebn77mLMZUVVB7WcAuyuuM3is9LqaBaywBsvx6UUvXu9pmdKWmppb7Sepy928XVhSp+ C/tNMu2k1rKnkpqAehAiweUOowg8sPNoEmO/7BbS0o3UDaC56dq6FoG7LlAF5P932hfu u1PdiUDgcIRjW6CxknTFLYlqqK9krcoJCJaHya4iFZ9OSGLKL9KHekdODuVK9VterSE8 PADHL574usZd8m/R8tZo472QaTEKw/Xdd41gTlOhFDrBjHjwuvPOUNrs6SIM+7M7EkHa XQlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=slh6yBO0jWz0DFWzHcd2paEGLCk5s4IJ70Q+yDxTFuY=; b=jTYnoxaMHl+OJOf6FmkXkSE+TIkao3UxlGQ46tAHHuAVL+nXQbGLlRTivc340wiR+H +oHtHgk7Ioy7beWRLLmLGx22TuEKgo/Pl3YrHMatDOe8ECS+OBsKzMLL5zlsmR/vw6m1 iCW3vCm/5oNT51oihpFvwrcKx7NBBEn4dOH3joyEbfBvfE7MckXTVO9hxqHZTaATfsXp H7keD4s9j5zvu0SHkI/+Sqt0xxzEHi5MBsjdONNBxr2RQ/bMf4Rae+w2PEQC1yInugbd C3FS6txCN7uVoc8pIkX0PBhYztamRUOM46f8LEonP7A2vpEVMWVWWEuFgZbEIFTAPz3i 72/A== X-Gm-Message-State: AOAM533+kAAGX8WDLte56TgPglDIkbhijlDwOiTgDoy9Eak6WHDMKo6M PT/tNKGz7PaAh2jPhVGwtHJUBSXsUj3r0PEMW5/lnbaz/d8= X-Google-Smtp-Source: ABdhPJyJxzwH+lwTpRD18ce5tbF+GbQXOCSDf34DiYcEvCTNBok1zBFNkbQYfsqAFv2hk7qycc2sZ/FzGRmNc0YNqL0= X-Received: by 2002:a25:4487:: with SMTP id r129mr34627318yba.14.1591158077560; Tue, 02 Jun 2020 21:21:17 -0700 (PDT) MIME-Version: 1.0 From: Steve French Date: Tue, 2 Jun 2020 23:21:06 -0500 Message-ID: Subject: [PATCH][SMB3] default to minimum of two channels when multichannel specified To: CIFS , =?utf-8?q?Aur=C3=A9lien_Aptel?= , ronnie sahlberg Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org When "multichannel" is specified on mount, make sure to default to at least two channels. Reviewed-by: Aurelien Aptel From ed58e117d1dc4b8aa317b251626958b5ffb06f5d Mon Sep 17 00:00:00 2001 From: Steve French Date: Tue, 2 Jun 2020 23:17:16 -0500 Subject: [PATCH] smb3: default to minimum of two channels when multichannel specified When "multichannel" is specified on mount, make sure to default to at least two channels. Signed-off-by: Steve French --- fs/cifs/connect.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index daf90f988de1..fdfd7cf4c720 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -1964,9 +1964,13 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, break; case Opt_multichannel: vol->multichannel = true; + /* if number of channels not specified, default to 2 */ + if (vol->max_channels < 2) + vol->max_channels = 2; break; case Opt_nomultichannel: vol->multichannel = false; + vol->max_channels = 1; break; case Opt_compress: vol->compression = UNKNOWN_TYPE; -- 2.25.1