From patchwork Fri Aug 30 03:39:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 1155647 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-cifs-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="m9odDYGs"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 46KQG13W2rz9sN6 for ; Fri, 30 Aug 2019 13:39:37 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727930AbfH3Djg (ORCPT ); Thu, 29 Aug 2019 23:39:36 -0400 Received: from mail-io1-f43.google.com ([209.85.166.43]:38171 "EHLO mail-io1-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727410AbfH3Djf (ORCPT ); Thu, 29 Aug 2019 23:39:35 -0400 Received: by mail-io1-f43.google.com with SMTP id p12so11315370iog.5 for ; Thu, 29 Aug 2019 20:39:34 -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=iPiVVygyTzshFzwm87GgNCZ7/PmuMy0RzTW47icynMg=; b=m9odDYGsF7+ftXabJz81XkN5Ysbx7BNwUWvTe1Qydef1uXVAtqLj6ENnM4M13K5QtF E3NF0xdUulyvpGP4VPBBNp7kNbby9yeVlis9bWFfBYqiOeTBZe1jqrHqmwW4afCvzrVm XXanYoTpDNMBGL43/Nh2myvP6z25HY0gsdHiTUm1Fg6tu/fsdzuP6TBq4BSmFnkuIpuE PHRtqZ/0wC3I2kVjSfUsQuUQ7w1Oo4dcOwGT7BCZQUSVa9OxvNklhv3J3Nbq0bCP+JBx iknK8+AYbL4zXFuLzMA70tiTnCgCOtOvBcxKH9BmLbQzT+c1GmwWQFRTWCDIhtD0KkNO lMjw== 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=iPiVVygyTzshFzwm87GgNCZ7/PmuMy0RzTW47icynMg=; b=deHwARxN0jdPhA3g9jfGe10dHMQtBtSIoWy9aZNV1E6+fT4pM6JCyJssne4UjzPmqh 7fLi3ogj+8Li6/zMbYNQE8zTCUhG01SMQHNSAMvcdi19MTGmEyeK9bemK5OwRS4KK6r9 xJ20zwR+MVwsc0qqwzCLSj7xkV1azXKqomY33ZjIySyDcHufHYJbgnv4E9UiWI7m84xY sdsLRAfMyMKUvjqU0/hCj1G04EQGeMkfxTpbv0GdiazAEXlGX9ac9HyjTW3qOIvwIcHR vwIFPru8NECNzl7puli/STO60EAInumrMWCvsQKTNfHzhH1dKSya5G1lLG6TWm6dEgsD d1JQ== X-Gm-Message-State: APjAAAX/Ff0IzbUDp/sOnOZHlJrYkqZMEX0T1sy8DLRaUbYkDwDbUiLI qidv7J7f8olIQgxYBWtfYtS6SEKIYI2EmzEMD846SlNkZjc= X-Google-Smtp-Source: APXvYqwDVc4342YdVnU/Cw2UDk2KyV2bEzE9CSSxVRKoQHUeR98/xnS7mciT3xLReHpHxRNH0Fp0ysCZ+6kA+jNtHiw= X-Received: by 2002:a6b:6a07:: with SMTP id x7mr1838234iog.168.1567136373844; Thu, 29 Aug 2019 20:39:33 -0700 (PDT) MIME-Version: 1.0 From: Steve French Date: Thu, 29 Aug 2019 22:39:22 -0500 Message-ID: Subject: [SMB3][PATCH] Add more detailed log information on cache=ro mounts To: CIFS Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org Make it easier to tell if the share we are mounting with cache=ro is considered read only by the server. Obviously there are cases where the user could know that no one will be writing to the share but this additional information could be helpful. $ dmesg [374786.661113] CIFS: Attempting to mount //localhost/test [374786.661130] CIFS VFS: mounting share with read only caching. Ensure that the share will not be modified while in use. [374786.662199] CIFS VFS: read only mount of RW share [374793.473091] CIFS: Attempting to mount //localhost/test-ro [374793.473109] CIFS VFS: mounting share with read only caching. Ensure that the share will not be modified while in use. [374793.474266] CIFS VFS: mounted to read only share From dd2abf8bbeb317555a0aa7132f663dfe30ae2911 Mon Sep 17 00:00:00 2001 From: Steve French Date: Thu, 29 Aug 2019 22:33:38 -0500 Subject: [PATCH] smb3: add some more descriptive messages about share when mounting cache=ro Add some additional logging so the user can see if the share they mounted with cache=ro is considered read only by the server CIFS: Attempting to mount //localhost/test CIFS VFS: mounting share with read only caching. Ensure that the share will not be modified while in use. CIFS VFS: read only mount of RW share CIFS: Attempting to mount //localhost/test-ro CIFS VFS: mounting share with read only caching. Ensure that the share will not be modified while in use. CIFS VFS: mounted to read only share Signed-off-by: Steve French --- fs/cifs/connect.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 4e622953dd5a..072c01f4e9c1 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -4197,8 +4197,16 @@ static int mount_get_conns(struct smb_vol *vol, struct cifs_sb_info *cifs_sb, tcon->unix_ext = 0; /* server does not support them */ /* do not care if a following call succeed - informational */ - if (!tcon->pipe && server->ops->qfs_tcon) + if (!tcon->pipe && server->ops->qfs_tcon) { server->ops->qfs_tcon(*xid, tcon); + if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_RO_CACHE) { + if (tcon->fsDevInfo.DeviceCharacteristics & + FILE_READ_ONLY_DEVICE) + cifs_dbg(VFS, "mounted to read only share\n"); + else + cifs_dbg(VFS, "read only mount of RW share\n"); + } + } cifs_sb->wsize = server->ops->negotiate_wsize(tcon, vol); cifs_sb->rsize = server->ops->negotiate_rsize(tcon, vol); -- 2.20.1