I use qbittorrent for a long time and also on screenshot that I post you can see the qbittorrent GUI. And, I'm sorry I can't replicate your issue.
I have the issue only if I use a temp mount and I demount it. But this is obliousvly.
Can you please try to mount the folder on Debian by the command that I post before?
1 Like
I was mistaken probably from your Linux screen.
I really appreciate your help and taking your time to replicate the issue on your side.
Thanks a lot for that.
In this case I'll have to look more thoroughly at my settings.
I'm puzzled how all of this started suddenly and I get it on several Windows PCs and honestly I care mostly about them because they're widely used.
I really don't understand why other programs work properly without this issue.
@pesa1234 Is your Windows 11 build 24H2?
I've used the more trivial way and it works. Obviously I messed the things on Linux the last time. It worked previously.

I'm still unable to pinpoint the reason on Windows.
Currently I just make a folder (with Windows File Explorer) with the same name (as in the torrent) and then I start the torrent in qbittorrent and it completes OK. It just cannot create folders. On other shared folders (on Windows PC) there is no such issue.
@linkinjeon @pesa1234
Trying to resolve my issue I've played with the settings. Currently I have this ksmbd.conf
.
[global]
netbios name = QNAP
server string = Ksmbd on QNAP
workgroup = WORKGROUP
interfaces = br-lan
bind interfaces only = yes
ipc timeout = 20
deadtime = 15
map to guest = Bad User
######### Dynamic written config options #########
[QNAP-USB1]
path = /mnt/sda1
valid users = user1
create mask = 0666
directory mask = 0777
read only = no
guest ok = no
[QNAP-USB2]
path = /mnt/sdb1
force user = root
force group = root
create mask = 0666
directory mask = 0777
read only = no
guest ok = no
For qnap-usb1 share I have set the user user1
and option read only = no
but I cannot get full access to the share. I cannot write files nor directories.
The share is browse-able and read only although I have user and password set via ksmbd.adduser
.
In order to get full access I have to use force root
. Why am I unable to get full access without force root?
Even if I use force root
, qbittorrent (running on Windows 11) still cannot create any directory on my f2fs share. Any other software can create folders. Tomorrow I'll try with different filesystems.
In the meantime I've tried older qbittorrent running on Win 7 32-bit. Same inability to create folders.
Why am I unable to get full access without force root?
Can you share ls -l command result to check /mnt/sdb1(after mounting local filesystem) permission ?
your user account(ID) doesn't have permission, you should use force root to access files fully.
Tomorrow I'll try with different filesystems.
Okay, Let me know the result. And It would be helpful to get wireshark dump if you use windows client.
qbittorrent (running on Wndows 11 24H2) cannot create folders on f2fs, ext4 and exfat file systems. Tried on two PCs and two different routers.
Qbittorrent is only unable to make folders. Actually it creates a file without extension (instead of a folder) with an empty icon.
It can remove folders and create/remove files without any issue. That doesn't make sense.
Other programs running on the same PCs have no issues.
/mnt/sda1 is f2fs
root@QNAP:/mnt/sda1# ls -l
drwxr-xr-x 7 root root 3488 May 29 2024 Backup
drwxr-xr-x 2 root root 3488 Jan 3 2024 Documents
drwxr-xr-x 122 root root 24576 Dec 18 18:43 Movies
drwxr-xr-x 2 root root 3488 Dec 19 02:26 temp
drwxr-xr-x 3 root root 3488 May 29 2024 wlan
/mnt/extra is ext4
root@QNAP:/mnt/extra/qnap# ls -l
drwxr-sr-x 3 root adm 4096 Dec 19 02:35 QNAP
drwxr-sr-x 2 root adm 4096 Dec 3 19:28 adblock-Backup
drwxr-sr-x 2 root adm 4096 Dec 3 18:33 banIP-backup
drwxr-sr-x 2 root adm 4096 Dec 5 19:28 nlbwmon
/mnt/sda is exfat
root@MX4300:/mnt/sda# ls -l
drwxrwxrwx 2 root root 131072 Dec 19 15:03 System Volume Information
drwxrwxrwx 2 root root 131072 Dec 19 15:05 temp
I have this in log when I tried with user1
and option read only = no
. But here I mix two different issues and in order to be clear the below errors are seen only when there are no proper write permissions,
[189250.761151] ksmbd: kill command received
[189253.758931] ksmbd: Unable to close RPC pipe 0
[189253.758985] ksmbd: Unable to close RPC pipe 1
[189253.762279] ksmbd: Unable to close RPC pipe 2
[189253.766706] ksmbd: Unable to close RPC pipe 3
[189351.436834] ksmbd: kill command received
[189352.319660] ksmbd: Unable to close RPC pipe 0
[189550.775739] ksmbd: kill command received
[189553.921192] ksmbd: Unable to close RPC pipe 0
[189642.763869] ksmbd: mkdir(temp/New folder): creation failed (err:-13)
[189646.495772] ksmbd: mkdir(temp/New folder): creation failed (err:-13)
[189647.632194] ksmbd: mkdir(temp/New folder): creation failed (err:-13)
[189691.187292] ksmbd: kill command received
[189691.522144] ksmbd: Unable to close RPC pipe 0
[189721.742549] ksmbd: kill command received
[189726.082404] ksmbd: Unable to close RPC pipe 0
[189736.877731] ksmbd: File(New Text Document.txt): creation failed (err:-13)
[189736.881381] ksmbd: File(New Text Document.txt): creation failed (err:-13)
[189736.886597] ksmbd: File(New Text Document.txt): creation failed (err:-13)
[189736.895200] ksmbd: File(New Text Document.txt): creation failed (err:-13)
[189739.767495] ksmbd: File(New Text Document.txt): creation failed (err:-13)
[189739.770648] ksmbd: File(New Text Document.txt): creation failed (err:-13)
[189739.777130] ksmbd: File(New Text Document.txt): creation failed (err:-13)
[189739.784793] ksmbd: File(New Text Document.txt): creation failed (err:-13)
[189744.823578] ksmbd: mkdir(New folder): creation failed (err:-13)
[189746.116460] ksmbd: mkdir(New folder): creation failed (err:-13)
[189786.406339] ksmbd: kill command received
[189790.732856] ksmbd: Unable to close RPC pipe 0
[189807.613559] ksmbd: mkdir(QNAP/backup/New folder): creation failed (err:-13)
[189998.711157] ksmbd: mkdir(temp/New Folder): creation failed (err:-13)
[190003.637703] ksmbd: mkdir(temp/New Folder): creation failed (err:-13)
[190010.799525] ksmbd: File(temp/New Empty File): creation failed (err:-13)
[190013.985035] ksmbd: File(temp/New Empty File): creation failed (err:-13)
[191796.405717] ksmbd: kill command received
[191796.519906] ksmbd: sock_read failed: -108
[191796.520048] ksmbd: Unable to close RPC pipe 0
[192048.120937] ksmbd: kill command received
[192048.362593] ksmbd: sock_read failed: -108
[192048.362818] ksmbd: Unable to close RPC pipe 0
[192048.365593] ksmbd: Unable to close RPC pipe 1
@linkinjeon I've got a wireshark dump. How can I send it to you to check.
Here is only the part the errors start from.
Is anyone able to use ksmbd with more that one user. Guest access is disabled. Trying to resolve my issue with qbittorrent I've tried different things. As I have two USB3 ports and one eMMC device (so I have three shares, and another cloud storage that is used as a local share with rclone) on my router I wanted to setup several users so every share can be accessed/used by different users with different permission levels.
But setting up two users with passwords and adding them to allowed users for each share doesn't work for me. On Windows 11 I simply get a message that I cannot access the second share with its user. I have to set only one user to be able to access both shares.
@linkinjeon Did you check the wireshark dump I posted.
Another possible hang issue with ksmbd here.
Did you check the wireshark dump I posted
Can you send me dump file ? I need
Another possible hang issue with ksmbd here
I can not find how ksmbd cause hang issue. If ksmbd cause hang issue, hunk task in kernel will show backtrace. Is there any backtrace from kernel ?
@sppmaster Can you tell me what you tried to create directory name in packets ?
I've started a torrent and I expected that the torrent client (qbittorrent) was going to create a directory (as it always did before kernel 6.6.54 on a ksmbd share), but it simply failed with Incorrect Parameter error message.
Instead of a directory it creates an unknown file without any extension with the size of the torrent and empty rectangular icon.
The error is still present on kernel 6.6.68 as of today.
Other programs that I use can create directories on the ksmbd share without any issues.
This issue occurs on Windows 11.
On Debian qbittorrent creates directories normally.
Okay, So You don't know what directory name is not created by qbittorrent. there are several creation failures in packets. I need to know what filename is not created for directory. Have you ever tried to check this combination => samba & f2fs ?
Actually I've found out that the file system does not matter. It cannot create a directory on any file system that is shared with ksmbd.
I've tried to get the Ubuntu iso via torrent and choose from the program options to create a directory with the same name as the iso file but it cannot do it
What I am saying, Have you tried to check it with samba, not ksmbd ? I am wondering how samba handle it.
I understand but I didn't try with Samba. I will try it in a few days and I'll report.
Okay, If there is no problem with samba, Please dump packets and give me it to compare what is different. Thanks for your help.
2 Likes
Another user has just joined the party.
Can you try to test it after apply this patch ?
diff --git a/fs/smb/server/vfs.c b/fs/smb/server/vfs.c
index 88d167a5f8b7..40f08eac519c 100644
--- a/fs/smb/server/vfs.c
+++ b/fs/smb/server/vfs.c
@@ -1264,6 +1264,8 @@ int ksmbd_vfs_kern_path_locked(struct ksmbd_work *work, char *name,
filepath,
flags,
path);
+ if (!is_last)
+ next[0] = '/';
if (err)
goto out2;
else if (is_last)
@@ -1271,7 +1273,6 @@ int ksmbd_vfs_kern_path_locked(struct ksmbd_work *work, char *name,
path_put(parent_path);
*parent_path = *path;
- next[0] = '/';
remain_len -= filename_len + 1;
}
2 Likes
What file should I apply that patch on?
I can find
/openwrt-ipq-QNAP/build_dir/target-aarch64_cortex-a53_musl/linux-qualcommax_ipq807x/linux-6.6.69/fs/smb/server/vfs.c
I've added the patch to target/linux/qualcommax/patches-6.6/0981-2-ksmbd_vfs_fix.patch
and will recompile.
Yes. vfs.c file should be patched. Let me know if you test it after recompiling kernel source.