Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some shares are not accessible from Windows 11 (and RDMA seems to be disabled) #302

Open
janos666 opened this issue Aug 30, 2023 · 4 comments

Comments

@janos666
Copy link

I tried to migrate from Samba to KSMB. I went through the config parameters and adjusted my old smb.conf settings accordingly.
I have a minimalistic setup with two shares from the same filesystem:

[global]
hide dot files = no
inherit owner = yes
vfs objects = acl_xattr
bind interfaces only = yes
interfaces = br0

[data]
path = /mnt/data
writable = yes
valid users = root zsofia

[surveillance]
path = /mnt/data/surveillance
writable = no
valid users = root zsofia istvan

The access was further refined with ACL. It works with Samba.

Now I can't connect with Windows 11 File Explorer.
Using Owlfiles (I came across it while using google to find answers for this issue) I can connect as root but I can only access [surveillance] but [data] is completely empty.

I am not sure if this is a kernel code or userspace tools issue.

By the way...
CONFIG_SMB_SERVER_SMBDIRECT seems to be disabled in linux-6.5.0-gentoo sources. I can see it after hitting Z in menuconfig but I can't enable it. Is it an upstream change or gentoo specific? (This is what initially got me interested in KSMD when I randomly stumbled upon it in menuconfig.) Using / I see this:

(1) -> SMB3 server support (EXPERIMENTAL) (SMB_SERVER [=y]) x
x -> Support for SMB Direct protocol (SMB_SERVER_SMBDIRECT [=n]) x
x Selects: SG_POOL [=y]

Using Z, I see this:

x - - Support for SMB Direct protocol x

@namjaejeon
Copy link
Member

namjaejeon commented Aug 31, 2023

Now I can't connect with Windows 11 File Explorer.

What is meaning "connect" ? You can not login using "zsofia" account at windows 11 client ?

Is it an upstream change or gentoo specific?
it is disable by default in mainline. You need to enable in menuconfig and build again. This configs depend on depends on the following. You can see it in Kconfig(fs/smb/server/Kconfig).

SMB_SERVER=m && INFINIBAND && INFINIBAND_ADDR_TRANS || SMB_SERVER=y && INFINIBAND=y && INFINIBAND_ADDR_TRANS=y.

i.e. inifiniband configs should be enable first. If it is not enable, it is gentoo specific.

@janos666
Copy link
Author

janos666 commented Aug 31, 2023

I have an ethernet NIC that supports "RDMA offloaded transport over Ethernet". Will KSMB's RMDA implementation work with this NIC if I enable the InfiBand stuff in the kernel config or is it limited to actual InfiBand hardware (which this card is clearly NOT)?
This is what Windows tells me about the card's RDMA capabilities/status (on the other side of the ethernet link):

Get-NetAdapterRdma -Name "*"

Name InterfaceDescription Enabled Operational PFC ETS


Ethernet 2 Mellanox ConnectX-2 Ethernet Adapter True True NA NA

I only added root to ksmbdpwd.db for now with an easy to type password for testing.
By the way, not being able to use aliases like Windows's [email protected] = zsofia on Linux (smbusers for Samba) might be an issue for me (since my Windows email is translated to root, so I would need to introduce a new Linux user to the ACL). It's something that can be done, of course, but something I really don't want to get into unless I see some benefits from testing RDMA against Samba's vfs_io_uring.

After running this on the server (with Samba stopped):

ksmbd.mountd -v -n

I see normal debug messages (all two shares and the one valid root user added, three non-existing users dropped).

When I type \192.168.1.11 or ..\data or ..\surveillance to the Windows 11 File Explorer, I get zero new messages from ksmbd.mountd but Windows drops up a window with error 0x80004005 (which points to a Microsoft article about Adobe Flash updates that is clearly not applicable to Windows 11 since Flash was dropped a long time ago) saying "Windows can't access 192... DIAGNOSE ... CLOSE".

When I open Owlfiles -> Connection -> New connection , I get to choose Windows or Linux (among may others).
The last time I picked Linux and it partially worked ([surveillance] was accessible, [data] was not). Although that time I started ksmbd.mountd with -p 446 (because I restored Samba that uses the default 445).
Now I tried accessing ksmb with Owlfiles on port 445 and it doesn't work. It keeps asking for login details. The ksmbd.mountd debug log says nothing.
I changed the port to 1445 (for both ksmbd.mountd and Owlfiles, adding both a "Windows" and a "Linux" type connection for Owlfiles) and it's the same (ksmbd.mountd is silent in verbose mode and Owlfiles keeps asking for login details which I double-checked). It's a mess...

@achirkin
Copy link

achirkin commented Mar 13, 2024

I'm curious to know, @janos666, were you able to setup SMB direct over RDMA in the end here?

@janos666
Copy link
Author

I'm curious to know, @janos666, were you able to setup SMB direct over RDMA in the end here?

No, I didn't even get to the RDMA part (I mean, I didn't even check the RDMA status while testing things) because I had trouble accessing the shares with Win11's file explorer in general and Samba's windows_email=linux_user mapping is way too convenient for me to give up on just for RDMA. At the same time (while reading about related things) I realized Samba had implemented io_uring, so I enabled that instead (this is obviously not the same thing at all but since this is a dedicated home server where the CPU is mostly idle, I decided that Samba with io_uring should be performant enough even if I eventually move from HDD RAID Btrfs to Bcachefs with an NVMe SSD cache). (P.s.: I also replaced the old G4400 with an E3-1230 I found for cheap, so my CPU performance is now ~2.5x with 2x the cores + the HT threads. Thus, io_uring has plenty of CPU thread to work with.)
RDMA would still be nice to have (just for the sheer sake of it and "why not if the NIC's support it?") but not at the cost of the username mapping feature of Samba.
May be I will revisit this when KSMBD adds the same username mapping feature and/or merges with Samsba,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants