-
Notifications
You must be signed in to change notification settings - Fork 61
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
Can not see any file in the directory via smb when the directory is a mount point, but the files indeed exist. #436
Comments
Let me check it. Please use cifsd-team/ksmbd github till fixing this. |
I discovered the same problem after going from kernel 6.3.8 to 6.4.2. Loading back into 6.3.8 got it working again. Is there already a suspected bad commit? |
For me its appearing empty while sharing a btrfs partition, a xfs one is working, not sure it its related. |
Here it's /dev/sdb1, which is an external hdd ext4 connected by usb. |
Mine is also an external usb disk. |
The issue appeared on kernel 6.3.10. 6.3.9 is fine. I did a git bisect and commit ef6cc1c465786b3e4e735d1ab8b616b3e94402df seems to be the culprit. ef6cc1c465786b3e4e735d1ab8b616b3e94402df is the first bad commit
fs/ksmbd/smb2pdu.c | 147 ++++------------- |
Changed the path lookup part to fix various racy issues. You can not lookup cross mount points such as usb disks in share. Same with NFS. In case of NFS, the usb disk should be registered as a share in the share directory and try mount using client. Question is that.... Is this issue important to you? |
e.g. Add share sections for each usb disks. and mount each shares like NFS.
I know this is also a problem with ksmbd, but it's easier to fix than the cross mount lookup as before. As before, we are checking if cross mount lookup is possible. It will take some more time. |
Mine is:
The external share appears on Windows 10, but its empty, but in reality it isn't empty. It used to work, but stopped in recent kernels. |
@falsovsky Yes, I can fix it easily. But I am wondering,
if anyone really needed a cross mount lookup as mentioned above. |
This problem is not only for external usb. I found the same problem on a rack server on /dev/sg1, which is an internal 18TB 3.5" hdd ext4. One dir works fine while another appears empty on that same drive. I create a single root share by bindmount'ing dirs from different hdd's to the shared dir. This way my share only contains dirs I want and doesn't force me to share the entire contents of a hdd mount. I also never have to touch a samba config. It's worked great til this problem. It would seem if commit ef6cc1c465786b3e4e735d1ab8b616b3e94402df tries to fix a race condition problem, but breaks otherwise working systems in the process, then that commit is problematic. The best solution would be one that resolves the race condition and does not break otherwise working setups. |
@bacon-cheeseburger You're right. It's not just an external problem. It's all a problem if you have a cross mount. Let me check it. give the time to me. |
Can you check if this patch fix your issue ? 5f3286b |
Which kernel should this be tested against? It fails to apply against 6.4.2. |
@bacon-cheeseburger Okay, Please try this patch.
Thanks. |
Hello, I tested patch 7d8eb8f against kernel 6.4.2. It solves the cross mount issue - folders are no longer empty on smb share, but, unfortunately, it seems it introduce another error: iul 10 13:34:22 mini.cweb.ro sshd[877]: Accepted publickey for root from 192.168.78.254 port 37554 ssh2: [...] My setup: Error appear sporadically, running, for example, ls -alsR /mnt/usb (there smb share was mounted for testing), or simply browsing the directory structure with mc. Thank you! |
@costel78 Thanks for your check! Could you please check this change fix your kernel oops ?
|
@namjaejeon Thank you very much for your work! |
The fix works here as well. I didn't get an error with the unmodified patch but have since applied the secondary one on top and still working good so far. |
@costel78 @bacon-cheeseburger Thanks for your check. I have combined secondary patch into first patch. I will apply this patch to the mainline. |
Thank you for quickly resolving this issue! |
Good to know that the issue was fixed. It also affected me as I'm using Arch and upgraded to the latest 6.4 kernel. I have an external USB drive that I'm sharing using ksmb and all was fine till 6.4 |
The issue is still there with the latest 6.4 kernel on Debian. |
This patch is not merged into mainline yet. There is a process to apply it. We need the more time. |
Am I alone in thinking that the offending commit should be reverted right away? All of my ksmbd deployments involve non-root mounts (e.g. |
I fully agree, as an Arch user it really created problems for me as I was relying on this to share my files from my USB attached drive. |
This fixes is applied to the mainline. It will propagate to the stable kernel versions next week. You should install the latest ksmbd-tools 3.4.9 version for this issue. |
Thanks. This is good to know. In the meantime I switched to kernel-lts in Arch and with this kernel (6.1x) things are back to normal. |
Hi, the patch for this was applied to 6.4.8 stable kernel version and linux-6.5-rc version. Please close THE ISSUE if it is clear. |
Hi @namjaejeon I just compiled 6.4.8, but my problem still persists. |
@falsovsky Can you try it again after upgrading the latest ksmbd-tools 3.4.9 version? |
@namjaejeon Working! Thanks. My problem is fxed. |
@falsovsky Thanks for your check! Closed this issue. Please reopen it if problem is still there. |
I share a directory "myshare". In that directory, I create a directory "mount" which is used as a mount point used to mount "/dev/sdb1". last week,it ran good.But now,I can not see any file in the "mount" via smb. But the files is indeed in the "mount" directory when I "ls" the "mount" directory . I use archlinux, the kernel is updated from 6.3 to 6.4.1.
The text was updated successfully, but these errors were encountered: