From patchwork Tue Sep 3 22:54:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 11129059 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 0F2E214F7 for ; Tue, 3 Sep 2019 22:54:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E2CAB22CF8 for ; Tue, 3 Sep 2019 22:54:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HDnpZZzG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726090AbfICWy3 (ORCPT ); Tue, 3 Sep 2019 18:54:29 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:41298 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726009AbfICWy3 (ORCPT ); Tue, 3 Sep 2019 18:54:29 -0400 Received: by mail-io1-f68.google.com with SMTP id f19so1469479iof.8 for ; Tue, 03 Sep 2019 15:54:29 -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=XX6PnSS0XGg/J1ZrD4AQewrN8q/0nOz94IYH1WHzKjk=; b=HDnpZZzGzCPGC3Wpm2akx2tC2hmTaty2GGI0YqIg89UeaTKrtF3HjiXpy7s+u7aua4 fTTlC+Gvy2/fN9YnN6Ox4WFTRa47SE4KfmH7UfoLlS5jhLfzd3Pg7p/WtmHQjlcjSH2I GjhMjjXrhLGrMuu81xo2ji5Mubghht0jWqwnn0Bq0tRMI9CLNzHjFryx+MjgV4rjZG3Q caZe1VXaQHm4bamKHxcV/1umzHeYaqevtN9kEjvLBTI3NF+0ENIuZRyCYVYomXXRAYlE mmuw6IBgdfA5uQTR4gX5rUkM9fQ+54QuNvQw2AYMP/MJ2ckh8CQVftWkD5HHCyzIb0LI mwog== 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=XX6PnSS0XGg/J1ZrD4AQewrN8q/0nOz94IYH1WHzKjk=; b=hpPrQxojYeEHXnMqsZJBRyr6icqA7H5cs1kIXiDrNzvCMCb5j95rqSeq84ngg/YV11 uXwvRHumloQid7Hx3ZNHahhil1BiwLnDWxy0F+fceU3TFcBg/vHi+hQyvC8ckvRp499a Mss8Rw1l1XMdPR7jfqOEJhcDs0UG2onyEbczFM3BE4yNVq36BFkY2QsIADQ8jHlj5on8 r/tsm8Jy12NpiDpsCrxP2Z2gk2Kr2KZ765u5LPjxgufgllWFUcEeBIZph5eJoIcuyFST 2WUleI94Gik7wmI/bLz9cKoriZCzfTd/VHZo8fjln8fe6jLL8YuoJpWgtuo9dJDFJa2X beMQ== X-Gm-Message-State: APjAAAUgRZ5nt4dO14E/vJtE1+ElKorHwty+b13ukuCtkAiW5RTLdWRO 9acZJSDg/NIEsBgepTb+60iN33a/ryULqACkHlxQpVZgqhA= X-Google-Smtp-Source: APXvYqy7MJrikA6cZoW3mUqxKonOcNME2sfKdgUyF+KZXJfVpeBdjnL7cdGX0I3KFyK0uIxGxc69qqZfNntbTiAAEJY= X-Received: by 2002:a6b:6303:: with SMTP id p3mr1006199iog.169.1567551268258; Tue, 03 Sep 2019 15:54:28 -0700 (PDT) MIME-Version: 1.0 From: Steve French Date: Tue, 3 Sep 2019 17:54:17 -0500 Message-ID: Subject: [PATCH] smb3: log warning if CSC policy conflicts with linux kernel client cache mount option To: CIFS , samba-technical Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org If the server config (e.g. Samba smb.conf "csc policy = disable) for the share indicates that the share should not be cached, log a warning message in the Linux kernel client if forced client side caching ("cache=ro" or "cache=singleclient") was requested on mount. Signed-off-by: Steve French Reviewed-by: Ronnie Sahlberg --- fs/cifs/connect.c | 8 ++++++++ 1 file changed, 8 insertions(+) /* * We can have only one retry value for a connection to a share so for * resources mounted more than once to the same server share the last From dae931c02aed14427ea4022c7e8038ab3103b4d9 Mon Sep 17 00:00:00 2001 From: Steve French Date: Tue, 3 Sep 2019 17:49:46 -0500 Subject: [PATCH] smb3: log warning if CSC policy conflicts with cache mount option If the server config (e.g. Samba smb.conf "csc policy = disable) for the share indicates that the share should not be cached, log a warning message if forced client side caching ("cache=ro" or "cache=singleclient") is requested on mount. Signed-off-by: Steve French --- fs/cifs/connect.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index d9a995588c74..85f8d943a05a 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -3478,6 +3478,14 @@ cifs_get_tcon(struct cifs_ses *ses, struct smb_vol *volume_info) tcon->use_resilient = true; } + /* If the user really knows what they are doing they can override */ + if (tcon->share_flags & SMB2_SHAREFLAG_NO_CACHING) { + if (volume_info->cache_ro) + cifs_dbg(VFS, "cache=ro requested on mount but NO_CACHING flag set on share\n"); + else if (volume_info->cache_rw) + cifs_dbg(VFS, "cache=singleclient requested on mount but NO_CACHING flag set on share\n"); + } + /* * We can have only one retry value for a connection to a share so for * resources mounted more than once to the same server share the last -- 2.20.1