public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali@kernel.org>
To: Steve French <sfrench@samba.org>,
	Paulo Alcantara <pc@manguebit.com>,
	Ronnie Sahlberg <ronniesahlberg@gmail.com>
Cc: linux-cifs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/7] cifs: Add mount option -o reparse=none
Date: Sun,  6 Oct 2024 12:00:41 +0200	[thread overview]
Message-ID: <20241006100046.30772-3-pali@kernel.org> (raw)
In-Reply-To: <20241006100046.30772-1-pali@kernel.org>

This new mount option allows to completely disable creating new reparse
points. When -o sfu or -o mfsymlinks is not specified then creating any
special file (fifo, socket, symlink, block and char) will fail with
-EOPNOTSUPP error.

Signed-off-by: Pali Rohár <pali@kernel.org>
---
 fs/smb/client/cifsglob.h   | 3 +++
 fs/smb/client/fs_context.c | 4 ++++
 fs/smb/client/fs_context.h | 1 +
 3 files changed, 8 insertions(+)

diff --git a/fs/smb/client/cifsglob.h b/fs/smb/client/cifsglob.h
index 367f0ac6400d..7632d2ba5390 100644
--- a/fs/smb/client/cifsglob.h
+++ b/fs/smb/client/cifsglob.h
@@ -154,6 +154,7 @@ enum securityEnum {
 };
 
 enum cifs_reparse_type {
+	CIFS_REPARSE_TYPE_NONE, /* disable creating new reparse points */
 	CIFS_REPARSE_TYPE_NATIVE, /* native symlinks only */
 	CIFS_REPARSE_TYPE_NATIVE_NFS, /* native for symlinks, nfs for others */
 	CIFS_REPARSE_TYPE_NATIVE_WSL, /* native for symlinks, wsl for others */
@@ -165,6 +166,8 @@ enum cifs_reparse_type {
 static inline const char *cifs_reparse_type_str(enum cifs_reparse_type type)
 {
 	switch (type) {
+	case CIFS_REPARSE_TYPE_NONE:
+		return "none";
 	case CIFS_REPARSE_TYPE_NATIVE:
 		return "native";
 	case CIFS_REPARSE_TYPE_NATIVE_NFS:
diff --git a/fs/smb/client/fs_context.c b/fs/smb/client/fs_context.c
index e5de84912e3d..3e402961cc95 100644
--- a/fs/smb/client/fs_context.c
+++ b/fs/smb/client/fs_context.c
@@ -303,6 +303,7 @@ cifs_parse_cache_flavor(struct fs_context *fc, char *value, struct smb3_fs_conte
 
 static const match_table_t reparse_flavor_tokens = {
 	{ Opt_reparse_default,	"default" },
+	{ Opt_reparse_none,	"none" },
 	{ Opt_reparse_native,	"native" },
 	{ Opt_reparse_native_nfs, "native+nfs" },
 	{ Opt_reparse_native_wsl, "native+wsl" },
@@ -320,6 +321,9 @@ static int parse_reparse_flavor(struct fs_context *fc, char *value,
 	case Opt_reparse_default:
 		ctx->reparse_type = CIFS_REPARSE_TYPE_DEFAULT;
 		break;
+	case Opt_reparse_none:
+		ctx->reparse_type = CIFS_REPARSE_TYPE_NONE;
+		break;
 	case Opt_reparse_native:
 		ctx->reparse_type = CIFS_REPARSE_TYPE_NATIVE;
 		break;
diff --git a/fs/smb/client/fs_context.h b/fs/smb/client/fs_context.h
index 1011176ba3b7..5db06de2ed35 100644
--- a/fs/smb/client/fs_context.h
+++ b/fs/smb/client/fs_context.h
@@ -43,6 +43,7 @@ enum {
 
 enum cifs_reparse_parm {
 	Opt_reparse_default,
+	Opt_reparse_none,
 	Opt_reparse_native,
 	Opt_reparse_native_nfs,
 	Opt_reparse_native_wsl,
-- 
2.20.1


  parent reply	other threads:[~2024-10-06 10:01 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-06 10:00 [PATCH 0/7] cifs: Improve mount option -o reparse and support for native Windows sockets Pali Rohár
2024-10-06 10:00 ` [PATCH 1/7] cifs: Add mount option -o reparse=native Pali Rohár
2024-10-07  4:28   ` Steve French
2024-10-07 18:36     ` Pali Rohár
     [not found]       ` <CAH2r5mttO-aDq94QrLQm10xJRGLg=PULqX9fcfoykAweVVO+uQ@mail.gmail.com>
2024-10-10 22:21         ` Steve French
2024-10-10 22:38           ` Pali Rohár
     [not found]             ` <CAH2r5msEiD05ehJs_a05sP_rX7BkVH-9LZp8Sj6EFbpZA9bfrg@mail.gmail.com>
2024-10-10 22:44               ` Pali Rohár
2024-10-06 10:00 ` Pali Rohár [this message]
2024-10-06 10:00 ` [PATCH 3/7] cifs: Add support for creating native Windows sockets Pali Rohár
2024-10-10 21:47   ` Pali Rohár
2024-10-06 10:00 ` [PATCH 4/7] cifs: Add support for creating NFS-style symlinks Pali Rohár
2024-10-06 10:00 ` [PATCH 5/7] cifs: Improve guard for excluding $LXDEV xattr Pali Rohár
2024-10-06 10:00 ` [PATCH 6/7] cifs: Add support for creating WSL-style symlinks Pali Rohár
2024-10-10 21:50   ` Pali Rohár
2024-10-06 10:00 ` [PATCH 7/7] cifs: Validate content of WSL reparse point buffers Pali Rohár
2024-10-12  8:52 ` [PATCH v2 0/7] Allow to choose symlink and socket type Pali Rohár
2024-10-12  8:55   ` [PATCH v2 1/7] cifs: Add mount option -o symlink= for choosing symlink create type Pali Rohár
2024-10-12  8:55   ` [PATCH v2 2/7] cifs: Add mount option -o reparse=none Pali Rohár
2024-10-12  8:55   ` [PATCH v2 3/7] cifs: Add support for creating native Windows sockets Pali Rohár
2024-10-12  8:56   ` [PATCH v2 4/7] cifs: Add support for creating NFS-style symlinks Pali Rohár
2024-12-09 18:00     ` Pali Rohár
2024-10-12  8:56   ` [PATCH v2 5/7] cifs: Improve guard for excluding $LXDEV xattr Pali Rohár
2024-10-12  8:56   ` [PATCH v2 6/7] cifs: Add support for creating WSL-style symlinks Pali Rohár
2024-10-12  8:56   ` [PATCH v2 7/7] cifs: Validate content of WSL reparse point buffers Pali Rohár
     [not found]   ` <CAH2r5mtGqqM35Cy5k9NN=X05rTZPk-adhb7LgoV8PGNVL9P6FQ@mail.gmail.com>
2024-10-13  4:19     ` Fwd: [PATCH v2 0/7] Allow to choose symlink and socket type Steve French
2024-10-13  8:59     ` Pali Rohár
2024-10-13 13:38     ` Pali Rohár
2024-10-14  9:32       ` Pali Rohár
2024-10-28 10:13   ` Pali Rohár

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241006100046.30772-3-pali@kernel.org \
    --to=pali@kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pc@manguebit.com \
    --cc=ronniesahlberg@gmail.com \
    --cc=sfrench@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox