From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: "Pali Rohár" <pali@kernel.org>,
"Steve French" <stfrench@microsoft.com>,
"Sasha Levin" <sashal@kernel.org>,
sfrench@samba.org, linkinjeon@kernel.org,
linux-cifs@vger.kernel.org, samba-technical@lists.samba.org
Subject: [PATCH AUTOSEL 6.13 29/32] cifs: Treat unhandled directory name surrogate reparse points as mount directory nodes
Date: Mon, 24 Feb 2025 06:16:35 -0500 [thread overview]
Message-ID: <20250224111638.2212832-29-sashal@kernel.org> (raw)
In-Reply-To: <20250224111638.2212832-1-sashal@kernel.org>
From: Pali Rohár <pali@kernel.org>
[ Upstream commit b587fd128660d48cd2122f870f720ff8e2b4abb3 ]
If the reparse point was not handled (indicated by the -EOPNOTSUPP from
ops->parse_reparse_point() call) but reparse tag is of type name surrogate
directory type, then treat is as a new mount point.
Name surrogate reparse point represents another named entity in the system.
From SMB client point of view, this another entity is resolved on the SMB
server, and server serves its content automatically. Therefore from Linux
client point of view, this name surrogate reparse point of directory type
crosses mount point.
Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/smb/client/inode.c | 13 +++++++++++++
fs/smb/common/smbfsctl.h | 3 +++
2 files changed, 16 insertions(+)
diff --git a/fs/smb/client/inode.c b/fs/smb/client/inode.c
index f146e06c97eb6..564f113bf739d 100644
--- a/fs/smb/client/inode.c
+++ b/fs/smb/client/inode.c
@@ -1215,6 +1215,19 @@ static int reparse_info_to_fattr(struct cifs_open_info_data *data,
rc = server->ops->parse_reparse_point(cifs_sb,
full_path,
iov, data);
+ /*
+ * If the reparse point was not handled but it is the
+ * name surrogate which points to directory, then treat
+ * is as a new mount point. Name surrogate reparse point
+ * represents another named entity in the system.
+ */
+ if (rc == -EOPNOTSUPP &&
+ IS_REPARSE_TAG_NAME_SURROGATE(data->reparse.tag) &&
+ (le32_to_cpu(data->fi.Attributes) & ATTR_DIRECTORY)) {
+ rc = 0;
+ cifs_create_junction_fattr(fattr, sb);
+ goto out;
+ }
}
break;
}
diff --git a/fs/smb/common/smbfsctl.h b/fs/smb/common/smbfsctl.h
index 4b379e84c46b9..3253a18ecb5cb 100644
--- a/fs/smb/common/smbfsctl.h
+++ b/fs/smb/common/smbfsctl.h
@@ -159,6 +159,9 @@
#define IO_REPARSE_TAG_LX_CHR 0x80000025
#define IO_REPARSE_TAG_LX_BLK 0x80000026
+/* If Name Surrogate Bit is set, the file or directory represents another named entity in the system. */
+#define IS_REPARSE_TAG_NAME_SURROGATE(tag) (!!((tag) & 0x20000000))
+
/* fsctl flags */
/* If Flags is set to this value, the request is an FSCTL not ioctl request */
#define SMB2_0_IOCTL_IS_FSCTL 0x00000001
--
2.39.5
next prev parent reply other threads:[~2025-02-24 11:17 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-24 11:16 [PATCH AUTOSEL 6.13 01/32] selftests/bpf: Adjust data size to have ETH_HLEN Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 02/32] bpf: unify VM_WRITE vs VM_MAYWRITE use in BPF map mmaping logic Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 03/32] selftests/bpf: Fix invalid flag of recv() Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 04/32] ASoC: Intel: sof_sdw: Add lookup of quirk using PCI subsystem ID Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 05/32] ASoC: Intel: sof_sdw: Add quirk for Asus Zenbook S14 Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 06/32] ASoC: Intel: sof_sdw: Add support for Fatcat board with BT offload enabled in PTL platform Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 07/32] ASoC: Intel: soc-acpi-intel-mtl-match: declare adr as ull Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 08/32] ASoC: simple-card-utils.c: add missing dlc->of_node Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 09/32] ALSA: hda/realtek: Limit mic boost on Positivo ARN50 Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 10/32] ASoC: rsnd: indicate unsupported clock rate Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 11/32] ASoC: rsnd: don't indicate warning on rsnd_kctrl_accept_runtime() Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 12/32] ASoC: rsnd: adjust convert rate limitation Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 13/32] ASoC: arizona/madera: use fsleep() in up/down DAPM event delays Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 14/32] ASoC: SOF: Intel: hda: add softdep pre to snd-hda-codec-hdmi module Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 15/32] PCI: pci_ids: add INTEL_HDA_PTL_H Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 16/32] ALSA: hda: intel-dsp-config: Add PTL-H support Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 17/32] ASoC: SOF: Intel: pci-ptl: Add support for PTL-H Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 18/32] ALSA: hda: hda-intel: add Panther Lake-H support Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 19/32] ASoC: SOF: amd: Add post_fw_run_delay ACP quirk Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 20/32] ASoC: SOF: amd: Handle IPC replies before FW_BOOT_COMPLETE Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 21/32] net: wwan: mhi_wwan_mbim: Silence sequence number glitch errors Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 22/32] io-wq: backoff when retrying worker creation Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 23/32] nvme-pci: quirk Acer FA100 for non-uniqueue identifiers Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 24/32] nvme-tcp: add basic support for the C2HTermReq PDU Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 25/32] nvmet-rdma: recheck queue state is LIVE in state lock in recv done Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 26/32] apple-nvme: Release power domains when probe fails Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 27/32] drm/xe: Make GUC binaries dump consistent with other binaries in devcoredump Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 28/32] cifs: Throw -EOPNOTSUPP error on unsupported reparse point type from parse_reparse_point() Sasha Levin
2025-02-24 11:16 ` Sasha Levin [this message]
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 30/32] sctp: Fix undefined behavior in left shift operation Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 31/32] nvme: only allow entering LIVE from CONNECTING state Sasha Levin
2025-02-24 11:16 ` [PATCH AUTOSEL 6.13 32/32] irqchip/qcom-pdc: Workaround hardware register bug on X1E80100 Sasha Levin
2025-02-24 14:46 ` Johan Hovold
2025-03-15 1:30 ` Sasha Levin
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=20250224111638.2212832-29-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=linkinjeon@kernel.org \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pali@kernel.org \
--cc=samba-technical@lists.samba.org \
--cc=sfrench@samba.org \
--cc=stable@vger.kernel.org \
--cc=stfrench@microsoft.com \
/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