From patchwork Sun Oct 6 10:00:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 1993238 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=WUTMWn0H; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:45e3:2400::1; helo=sv.mirrors.kernel.org; envelope-from=linux-cifs+bounces-3048-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org [IPv6:2604:1380:45e3:2400::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XLyV22D6Yz1xtN for ; Sun, 6 Oct 2024 21:01:14 +1100 (AEDT) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 5DAD2283187 for ; Sun, 6 Oct 2024 10:01:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B9513170A01; Sun, 6 Oct 2024 10:01:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WUTMWn0H" X-Original-To: linux-cifs@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8FED3F4F1; Sun, 6 Oct 2024 10:01:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728208869; cv=none; b=IlLCMIXxMGaR9uy2LbJH4soB74vaQVgu9BZLlGuSVNt26p2KWHy7HLwbs1TrXM7ZHlUOoD8WxcgjFW6GB1rvU2jLEVLI9iNa7owRQA6OJ6CBCXH94tXnsdhKiNAF3W0/BwRM+I2hAagz/sv9cCOFePfuFXkpVEBR+dn9FaJP368= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728208869; c=relaxed/simple; bh=rM4fCOYDK4HI6B5oF+uWsvRWPszXfVkG2GCmWRKlU/I=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=Il/YNymoiUgixn/nmJK9D63QlfmM9JitObZqUx3N4hotVX/fllQDFAW0VFYgYokNQkhfPbJy1xCKJzPX/pkGg3N+qQzha77jwPBhcoFEhKr7SkuTrEi0cup1hOo4p/5TNS8+KZnUgOR1AvDo5mSrQHIp/iC7RhgzVT5PWA5v6Ds= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WUTMWn0H; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0EAB8C4CECE; Sun, 6 Oct 2024 10:01:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1728208869; bh=rM4fCOYDK4HI6B5oF+uWsvRWPszXfVkG2GCmWRKlU/I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WUTMWn0HMXcXgLzcg8r939WIxmg+FiKbv+NJyiT7RSJd8QPUsKPYjjUeo+nVCDSZw Le/kw59rmTZ9s3niPxxrcBzgm61aMJywOG1RkWpvLVCr7/QlWmfW1QDMV6SMFsVqsa CNfQzINFKNwA9VZaGqxxnhz1EXDiWjyx8INkMVhFIkHEHDb7/IkAIEAQcsTTFPZIKe ab0IlG4YPXHeWoboaBNSgmjwi99sLYvr4cPD60+My1ILvcBYpWH1BzLDAOXxgSaPUP 2+MRoR5ofEtoJtNrEwKp+XWXP73KJ9/WXTVT89JhGIDpO33HDi+CU3u5tJFmY+oDLJ 3y1D2n64gcZbw== Received: by pali.im (Postfix) id 6B0A5BA4; Sun, 6 Oct 2024 12:01:02 +0200 (CEST) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Steve French , Paulo Alcantara , Ronnie Sahlberg 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 Message-Id: <20241006100046.30772-3-pali@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241006100046.30772-1-pali@kernel.org> References: <20241006100046.30772-1-pali@kernel.org> Precedence: bulk X-Mailing-List: linux-cifs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 --- 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,