cifsd-team / ksmbd

ksmbd kernel server(SMB/CIFS server)
151 stars 23 forks source link

folders becoming files with Ksmbd: 3.3.4 Kmod: 3.3.5 #498

Closed erdoukki closed 3 years ago

erdoukki commented 3 years ago

folders becoming files with Ksmbd: 3.3.4 Kmod: 3.3.5 on OpenWrt SNAPSHOT r15899-567a88e4b9 / LuCI Master git-21.050.34860-b8d2bcd on kirkwood Feroceon 88FR131 rev 1 (v5l) on a ZyXEL NSA310S copying with a cp from console is ok, but copying with GNOME nautilus 3.38.1 on ubuntu make folders beeing files at last. I have to remove the dos attribute manually to access the folders as folders again. find . -type d -exec setfattr -x user.DOSATTRIB "{}" \;

I get also some kernel error logged while accessing (copying or deleting) : [ 1765.711828] ksmbd: ndr_decode_dos_attr:180: v0 version is not supported
[ 1765.741612] ksmbd: ndr_decode_dos_attr:180: v0 version is not supported
[ 1765.757393] ksmbd: ndr_decode_dos_attr:180: v27695 version is not supported
[ 1765.757393] ksmbd: ndr_decode_dos_attr:180: v27695 version is not supported

namjaejeon commented 3 years ago

Ah, Are you saying that both 3.3.4 and 3.3.5 are problems? Or are the directories created in 3.3.4 appearing as a file in 3.3.5?

erdoukki commented 3 years ago

Both 3.3.4 and 3.3.5 are problems. The copied directories appears as files at the end of the copy process on both version

namjaejeon commented 3 years ago

Have you ever reproduce this issue with ksmbd 3.3.3 version ? Nautilus rsend a request to change directory to file using smb2 set info command. I added exception code to protect it. maybe, This change will include in 3.3.6 version.

erdoukki commented 3 years ago

I am new user of ksmbd so I haven't tested 3.3.3. I will wait for 3.3.6 and give you feedback about it...

namjaejeon commented 3 years ago

Sure, I will share 3.3.6 version release soon. I think that there is same issue in old ksmbd version. and nautilus seems to send wrong command to server. anyway. Thanks for your report to fix it!

namjaejeon commented 3 years ago

I have released ksmbd/ksmbd-tools 3.3.6 version. But You may wait for ksmbd package release by @Andy2244 or @neheb if you don't know how ksmbd can be manually installed on OpenWRT.

mrkiko commented 3 years ago

What I would try is to manually compile the kernel module with OpenWRt toolchain.

May I ask you to write down some instructions? What I would do is using openwrt/staging_dir toolchain, playing with CROSSCOMPILE?? stuff, and so on.

namjaejeon commented 3 years ago

@neheb Could you please answer @mrkiko 's question ?

neheb commented 3 years ago

I don't fully understand it. Compiling ksmbd for OpenWrt just takes running make menuconfig , selecting ksmbd , and running make

Andy2244 commented 3 years ago

I don't fully understand it. Compiling ksmbd for OpenWrt just takes running make menuconfig , selecting ksmbd , and running make

I think they ask how to create and compile 3.3.6 version, so they don't have to wait for the snapshot PR. If you can update again this would be nice, since samba-4.14 was just released and thats where i will spend my spare free time next.

erdoukki commented 3 years ago

3.3.7 installed and testing...

root@NSA310S:~# uname -ar
Linux NSA310S 5.4.105 #0 Sat Mar 13 22:20:02 2021 armv5tel GNU/Linux
## Network Shares
### Ksmbd: 3.3.7 Kmod: 3.3.7

no more working (not mounting share !) dmesg :

[282016.294913] CIFS: VFS: Error connecting to socket. Aborting operation.
[282016.294927] CIFS: VFS: cifs_mount failed w/return code = -2
[282022.220160] EXT4-fs warning (device sda1): htree_dirblock_to_tree:1004: inode #917738: lblock 0: comm sudo: error -5 reading directory block
[282022.229333] EXT4-fs warning (device sda1): htree_dirblock_to_tree:1004: inode #917738: lblock 0: comm sudo: error -5 reading directory block
gerald@P3530$ sudo mount -t cifs -o guest,rw,iocharset=utf8,file_mode=0777,dir_mode=0777 //nsa310s.lpm.nddc.gk2.net/NSA310S /mnt/test/ -v
mount.cifs kernel mount options: ip=10.4.2.117,unc=\\nsa310s.lpm.nddc.gk2.net\NSA310S,iocharset=utf8,file_mode=0777,dir_mode=0777,user=,pass=********
mount error(2): No such file or directory
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)

https://forum.openwrt.org/t/ksmbd-samba3-4-alternative-ex-cifsd-smbd-package-support-thread/51695/82

erdoukki commented 3 years ago

3.3.7 installed and testing... https://forum.openwrt.org/t/ksmbd-samba3-4-alternative-ex-cifsd-smbd-package-support-thread/51695/82

Do you prefer I open a new issue ?

mmakassikis commented 3 years ago

errno code = -2 is ENOENT. Verify the share's name is correct and that the path is points exists. Same on the client side: does /mnt/test exist ? Have you checked network connectivity ? Can you ping the OpenWRT host ? On the OpenWRT host, verify using netstat or ss (I don't know what OpeenWRT includes) that there is a socket bound on port 445 by the ksmbd kernel module and not samba.

erdoukki commented 3 years ago

share name ok (not changed from latest tests) local folder name ok ping ok and access ssh and web ok

root@NSA310S:~# netstat -an | grep 445
tcp        0      0 :::445                  :::*                    LISTEN      

no debug possibilities (missing tools from openwrt package)

erdoukki commented 3 years ago

OUPS !! forget to test and install packages block-mount and kmos-fs-ntfs ! my external drive was not here from OpenWrt ! fixed now...

erdoukki commented 3 years ago

My error ! 3.3.7 fixes the problem of folders !!! THANKS all for the job