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 8/8] cifs: Rename posix to nfs in parse_reparse_posix() and reparse_posix_data
Date: Sat, 28 Sep 2024 23:59:48 +0200 [thread overview]
Message-ID: <20240928215948.4494-9-pali@kernel.org> (raw)
In-Reply-To: <20240928215948.4494-1-pali@kernel.org>
This function parses NFS-style reparse points, which are used only by
Windows NFS server since Windows Server 2012 version. This style of special
files is not understood by Microsoft POSIX / Interix / SFU / SUA subsystems.
So make it clear that parse_reparse_posix() function and reparse_posix_data
structure are not POSIX general, but rather NFS specific.
Signed-off-by: Pali Rohár <pali@kernel.org>
---
fs/smb/client/cifsglob.h | 2 +-
fs/smb/client/cifspdu.h | 2 +-
fs/smb/client/reparse.c | 14 +++++++-------
fs/smb/client/reparse.h | 2 +-
fs/smb/common/smb2pdu.h | 2 +-
5 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/fs/smb/client/cifsglob.h b/fs/smb/client/cifsglob.h
index 9eae8649f90c..119537e98f77 100644
--- a/fs/smb/client/cifsglob.h
+++ b/fs/smb/client/cifsglob.h
@@ -223,7 +223,7 @@ struct cifs_open_info_data {
__u32 tag;
union {
struct reparse_data_buffer *buf;
- struct reparse_posix_data *posix;
+ struct reparse_nfs_data *nfs;
};
} reparse;
struct {
diff --git a/fs/smb/client/cifspdu.h b/fs/smb/client/cifspdu.h
index c3b6263060b0..fefd7e5eb170 100644
--- a/fs/smb/client/cifspdu.h
+++ b/fs/smb/client/cifspdu.h
@@ -1506,7 +1506,7 @@ struct reparse_symlink_data {
#define NFS_SPECFILE_BLK 0x00000000004B4C42
#define NFS_SPECFILE_FIFO 0x000000004F464946
#define NFS_SPECFILE_SOCK 0x000000004B434F53
-struct reparse_posix_data {
+struct reparse_nfs_data {
__le32 ReparseTag;
__le16 ReparseDataLength;
__u16 Reserved;
diff --git a/fs/smb/client/reparse.c b/fs/smb/client/reparse.c
index 35e8f2e18530..a23ea2f78c09 100644
--- a/fs/smb/client/reparse.c
+++ b/fs/smb/client/reparse.c
@@ -81,7 +81,7 @@ int smb2_create_reparse_symlink(const unsigned int xid, struct inode *inode,
return rc;
}
-static int nfs_set_reparse_buf(struct reparse_posix_data *buf,
+static int nfs_set_reparse_buf(struct reparse_nfs_data *buf,
mode_t mode, dev_t dev,
struct kvec *iov)
{
@@ -120,20 +120,20 @@ static int mknod_nfs(unsigned int xid, struct inode *inode,
const char *full_path, umode_t mode, dev_t dev)
{
struct cifs_open_info_data data;
- struct reparse_posix_data *p;
+ struct reparse_nfs_data *p;
struct inode *new;
struct kvec iov;
__u8 buf[sizeof(*p) + sizeof(__le64)];
int rc;
- p = (struct reparse_posix_data *)buf;
+ p = (struct reparse_nfs_data *)buf;
rc = nfs_set_reparse_buf(p, mode, dev, &iov);
if (rc)
return rc;
data = (struct cifs_open_info_data) {
.reparse_point = true,
- .reparse = { .tag = IO_REPARSE_TAG_NFS, .posix = p, },
+ .reparse = { .tag = IO_REPARSE_TAG_NFS, .nfs = p, },
};
new = smb2_get_reparse_inode(&data, inode->i_sb, xid,
@@ -313,7 +313,7 @@ int smb2_mknod_reparse(unsigned int xid, struct inode *inode,
}
/* See MS-FSCC 2.1.2.6 for the 'NFS' style reparse tags */
-static int parse_reparse_posix(struct reparse_posix_data *buf,
+static int parse_reparse_nfs(struct reparse_nfs_data *buf,
struct cifs_sb_info *cifs_sb,
struct cifs_open_info_data *data)
{
@@ -414,7 +414,7 @@ int parse_reparse_point(struct reparse_data_buffer *buf,
/* See MS-FSCC 2.1.2 */
switch (le32_to_cpu(buf->ReparseTag)) {
case IO_REPARSE_TAG_NFS:
- return parse_reparse_posix((struct reparse_posix_data *)buf,
+ return parse_reparse_nfs((struct reparse_nfs_data *)buf,
cifs_sb, data);
case IO_REPARSE_TAG_SYMLINK:
return parse_reparse_symlink(
@@ -507,7 +507,7 @@ bool cifs_reparse_point_to_fattr(struct cifs_sb_info *cifs_sb,
struct cifs_fattr *fattr,
struct cifs_open_info_data *data)
{
- struct reparse_posix_data *buf = data->reparse.posix;
+ struct reparse_nfs_data *buf = data->reparse.nfs;
u32 tag = data->reparse.tag;
if (tag == IO_REPARSE_TAG_NFS && buf) {
diff --git a/fs/smb/client/reparse.h b/fs/smb/client/reparse.h
index 5be54878265e..2a91f64de557 100644
--- a/fs/smb/client/reparse.h
+++ b/fs/smb/client/reparse.h
@@ -18,7 +18,7 @@
*/
#define IO_REPARSE_TAG_INTERNAL ((__u32)~0U)
-static inline dev_t reparse_nfs_mkdev(struct reparse_posix_data *buf)
+static inline dev_t reparse_nfs_mkdev(struct reparse_nfs_data *buf)
{
u32 major, minor;
diff --git a/fs/smb/common/smb2pdu.h b/fs/smb/common/smb2pdu.h
index c769f9dbc0b4..0e77a4c0145a 100644
--- a/fs/smb/common/smb2pdu.h
+++ b/fs/smb/common/smb2pdu.h
@@ -1550,7 +1550,7 @@ struct reparse_symlink_data_buffer {
__u8 PathBuffer[]; /* Variable Length */
} __packed;
-/* See MS-FSCC 2.1.2.6 and cifspdu.h for struct reparse_posix_data */
+/* See MS-FSCC 2.1.2.6 and cifspdu.h for struct reparse_nfs_data */
struct validate_negotiate_info_req {
__le32 Capabilities;
--
2.20.1
next prev parent reply other threads:[~2024-09-28 22:00 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-28 21:59 [PATCH 0/8] cifs: Fix support for NFS-style reparse points Pali Rohár
2024-09-28 21:59 ` [PATCH 1/8] smb: Update comments about some reparse point tags Pali Rohár
2024-09-28 21:59 ` [PATCH 2/8] cifs: Remove intermediate object of failed create reparse call Pali Rohár
2024-09-29 12:53 ` Pali Rohár
2024-09-29 14:03 ` [PATCH v2] " Pali Rohár
2024-09-29 16:01 ` Steve French
2024-09-30 15:25 ` [PATCH 2/8] " Paulo Alcantara
2024-09-30 17:20 ` Pali Rohár
2024-09-30 21:33 ` Paulo Alcantara
2024-09-30 20:25 ` [PATCH v3] " Pali Rohár
2024-09-30 21:33 ` Steve French
2024-09-28 21:59 ` [PATCH 3/8] cifs: Fix parsing NFS-style char/block devices Pali Rohár
2024-09-28 21:59 ` [PATCH 4/8] cifs: Fix creating " Pali Rohár
2024-09-29 0:18 ` Steve French
2024-09-29 0:44 ` Pali Rohár
[not found] ` <CAH2r5mvbUhcW_c46oUiHzfPg97n5qiRg9kzpCkmzG9uHygOF3g@mail.gmail.com>
2024-09-29 0:51 ` Pali Rohár
2024-09-28 21:59 ` [PATCH 5/8] cifs: Fix buffer overflow when parsing NFS reparse points Pali Rohár
2024-09-29 10:22 ` [PATCH v2] " Pali Rohár
2024-09-28 21:59 ` [PATCH 6/8] cifs: Do not convert delimiter when parsing NFS-style symlinks Pali Rohár
2024-09-28 21:59 ` [PATCH 7/8] cifs: Validate content of NFS reparse point buffer Pali Rohár
2024-09-28 21:59 ` Pali Rohár [this message]
2024-09-29 4:57 ` [PATCH 8/8] cifs: Rename posix to nfs in parse_reparse_posix() and reparse_posix_data Steve French
2024-09-29 9:09 ` Ralph Boehme
2024-09-29 9:26 ` Pali Rohár
2024-09-29 12:52 ` Ralph Boehme
2024-09-29 15:43 ` Steve French
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=20240928215948.4494-9-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