please try the attached image for the r7800 and gimme feedback if it solves your problem. if not, can you provide a tcpdump/wireshark capture if your samba traffic at the time the problem occures?
Hi BrainSlayer,
Thank you so much for that.
Like abhijitat, I was not able to make the router crash with the provided version (43721). I did get to see
Code:
<3>Jul 9 16:59:06 kernel: [ 2606.070836] ksmbd: build_sess_rsp_extsec:1198: Invalid phase
<3>Jul 9 16:59:08 kernel: [ 2608.175586] ksmbd: build_sess_rsp_noextsec:964: server challenge is not assigned in negotiate
Before, the Invalid phase error would be fatal, now it deals with the condition properly, it seems.
I verified that my test still crashes 43711 but not 43721. Awesome!
I do not see increased CPU usage. It peaks when there is a transfer (USB-Storage goes to the top), but it returns to normal after the transfer ends.
WRT the memory usage, it starts at 360M free, it drops to 88M, then it frees some and goes back to 100M or so. Will repeat the 88-100. But that is not new. The previous version (43711) did exactly the same.
Joined: 06 Jun 2006 Posts: 7463 Location: Dresden, Germany
Posted: Fri Jul 10, 2020 5:41 Post subject:
marcelo3d wrote:
BrainSlayer wrote:
please try the attached image for the r7800 and gimme feedback if it solves your problem. if not, can you provide a tcpdump/wireshark capture if your samba traffic at the time the problem occures?
Hi BrainSlayer,
Thank you so much for that.
Like abhijitat, I was not able to make the router crash with the provided version (43721). I did get to see
Code:
<3>Jul 9 16:59:06 kernel: [ 2606.070836] ksmbd: build_sess_rsp_extsec:1198: Invalid phase
<3>Jul 9 16:59:08 kernel: [ 2608.175586] ksmbd: build_sess_rsp_noextsec:964: server challenge is not assigned in negotiate
Before, the Invalid phase error would be fatal, now it deals with the condition properly, it seems.
I verified that my test still crashes 43711 but not 43721. Awesome!
I do not see increased CPU usage. It peaks when there is a transfer (USB-Storage goes to the top), but it returns to normal after the transfer ends.
WRT the memory usage, it starts at 360M free, it drops to 88M, then it frees some and goes back to 100M or so. Will repeat the 88-100. But that is not new. The previous version (43711) did exactly the same.
many, many times in the log, and sometimes some errors reported by Windows Explorer, but that doesn't crash the router.
Thank you so much BrainSlayer!
Cheers,
Marcelo.-
i already fixed the crash of the userspace daemon too. this wasnt included in the testbuild yet, but i made some test with another user last night to catch that error (and others). for the free ram etc. do not just take a look on free ram. buff/cache can be counted as usable memory too. and depending how many files you access at the same time smb may allocate alot of caches. (vlc does seem to open alot of blocks from the same file at the same time while playing) and its getting worse if smb3 is involved. smb2 only doesnt take that much memory. attached is a newer testversion _________________ "So you tried to use the computer and it started smoking? Sounds like a Mac to me.." - Louis Rossmann https://www.youtube.com/watch?v=eL_5YDRWqGE&t=60s
Joined: 06 Jun 2006 Posts: 7463 Location: Dresden, Germany
Posted: Fri Jul 10, 2020 6:23 Post subject:
some further info. the version i posted fixes a important issue. min server and max server protocol was never working due a wrong server parameter i used. this is now fixed. if you set min protocol and max protocol to 3.1.1 it will never work with windows 10. according to my findings windows 10 only works if smb2 is supported at minimum, but will connect with 3.1.1 of course. but it always checks for smb2 first and will fail if smb2 is not supported _________________ "So you tried to use the computer and it started smoking? Sounds like a Mac to me.." - Louis Rossmann https://www.youtube.com/watch?v=eL_5YDRWqGE&t=60s
Joined: 06 Feb 2020 Posts: 167 Location: Maharashtra, India
Posted: Fri Jul 10, 2020 7:30 Post subject:
Thanks BS,
setting up min version to SMB2 works perfect. no CPU high usage except normal behavior of spike during file transfer. cached memory is not reducing though after file transfer is complete, but not impacting for me as R7800 has a lot of memory and is also robust.
Update with 43731 Build
CPU usage normal as mentioned earlier.
File transfer happens successfully.
seeing following errors in syslog
Jan 1 05:30:39 R7800 user.info wsdd2[963]: starting.
Jan 1 05:30:39 R7800 user.err wsdd2[963]: error: wsdd-mcast-v4: wsd_send_soap_msg: send
Jan 1 05:30:39 R7800 user.err wsdd2[963]: error: wsdd-mcast-v6: wsd_send_soap_msg: send
Jan 1 05:30:39 R7800 user.err wsdd2[963]: error: wsdd-mcast-v6: wsd_send_soap_msg: send
Jan 1 05:30:39 R7800 user.info : smbd : samba started
Jan 1 05:30:39 R7800 local5.err ksmbd: [ksmbd-worker/971]: ERROR: Can't open `/tmp/smb.db': No such file or directory
Jan 1 05:30:39 R7800 local5.err ksmbd: [ksmbd-worker/971]: ERROR: User database file does not exist. Only guest sessions (if permitted) will work.
Jan 1 05:30:40 R7800 user.err wsdd2[963]: error: wsdd-mcast-v4: wsd_send_soap_msg: send
Jan 1 05:30:40 R7800 user.err wsdd2[963]: error: wsdd-mcast-v6: wsd_send_soap_msg: send
Jan 1 05:30:40 R7800 user.err wsdd2[963]: error: wsdd-mcast-v6: wsd_send_soap_msg: send
Jan 1 05:30:40 R7800 user.info : rp-pppoe : pppoe server successfully started
Jan 1 05:30:40 R7800 user.err wsdd2[963]: error: wsdd-mcast-v4: wsd_send_soap_msg: send
Database error is there as i was trying as guest, no users created. but rest of the errors are new
Joined: 06 Jun 2006 Posts: 7463 Location: Dresden, Germany
Posted: Fri Jul 10, 2020 7:52 Post subject:
the database error is normal if there is no user created. if there is no use, there is no database of course
there is also another odd behaviour (windows related, not my fault.) if your samba server is located at a remote network smb2 support is required for minimum as mentioned already. but if its a local network server in your own subnet, smb2 support isnt checked by windows and minimum protocol works also with 3.1.1
this is just some result of tests i did using packet captures and debugging. nothing i can fix or change since its pure client behaviour. _________________ "So you tried to use the computer and it started smoking? Sounds like a Mac to me.." - Louis Rossmann https://www.youtube.com/watch?v=eL_5YDRWqGE&t=60s
Joined: 06 Feb 2020 Posts: 167 Location: Maharashtra, India
Posted: Fri Jul 10, 2020 8:16 Post subject:
further update using 43731, the free memory is back to normal after about 15 minutes (+/- 1MB). which was not happening earlier though.
seems its working good now.
Thanks for all the efforts put you have in this.now I will try to use this router as music server as well. you have spared me a Raspberry PI for some other work
Linksys EA8500
DD-WRT v3.0-r43731 std (07/10/20)
Linux 4.9.230 #601 SMP Thu Jul 9 19:40:35 +03 2020 armv7l
samba still will not mount on Debian 11 ...k5.7.0-1-amd64
ksmbd: client requested dialect 0x311
ksmbd: selected SMB3_11 dialect
is all debug shows which is correct.
WORKS FINE if encryption is off but NOT if encrytion is reqiured.
using min & max 3.1.1
something to check:
server should have NegotiateContextList=0 for 3.1.1 only
Joined: 06 Jun 2006 Posts: 7463 Location: Dresden, Germany
Posted: Fri Jul 10, 2020 12:15 Post subject:
mrjcd wrote:
Linksys EA8500
DD-WRT v3.0-r43731 std (07/10/20)
Linux 4.9.230 #601 SMP Thu Jul 9 19:40:35 +03 2020 armv7l
samba still will not mount on Debian 11 ...k5.7.0-1-amd64
ksmbd: client requested dialect 0x311
ksmbd: selected SMB3_11 dialect
is all debug shows which is correct.
WORKS FINE if encryption is off but NOT if encrytion is reqiured.
using min & max 3.1.1
something to check:
server should have NegotiateContextList=0 for 3.1.1 only
i can verify with opensuse based on kernel 5.7 that encryption is working with 3.1.1
the problem as i said before multiple times. the cifs kernel modul need to be very recent and alot of crypto depenency modules must be loaded to get it working
this here is the successfull mount with encryption enabled and 3.1.1 and the server is running on a r7800
//172.29.0.56/test on /tmp/test type cifs (rw,relatime,vers=3.1.1,cache=strict,username=test,uid=0,noforceuid,gid=0,noforcegid,addr=172.29.0.56,file_mode=0755,
dir_mode=0755,soft,nounix,serverino,mapposix,rsize=4194304,wsize=4194304,bsize=1048576,echo_interval=60,actimeo=1)
regarding your negotiatecontextcount/list. this is only used for 3.1.1 and handled by the ksmbd server as it should. there is no parameter to configure for this. this is already handled based on the protocol version _________________ "So you tried to use the computer and it started smoking? Sounds like a Mac to me.." - Louis Rossmann https://www.youtube.com/watch?v=eL_5YDRWqGE&t=60s
some further info. the version i posted fixes a important issue. min server and max server protocol was never working due a wrong server parameter i used. this is now fixed. if you set min protocol and max protocol to 3.1.1 it will never work with windows 10. according to my findings windows 10 only works if smb2 is supported at minimum, but will connect with 3.1.1 of course. but it always checks for smb2 first and will fail if smb2 is not supported
According to smb.conf(5), 'min protocol' is a synonym for 'server min protocol', and 'max protocol' is a synonym for server max protocol. So this is not a problem.
Since I changed "min protocol" and "max protocol" to SMB2_02 and SMB2_10 respectively 3 days ago on my netgear wndr4300 running r43516, the router has been running fine and Windows 10 clients haven't experienced unrecoverable authentication failures when opening the shares requiring user authentication. Windows 10 still experiences recoverable glitches when opening them.
root@DD-WRT:~# dmesg | grep -i ksmbd | dmesg-uptime.awk
[Tue Jul 7 06:06:07 2020] ksmbd: kill command received
[Thu Jul 9 07:07:41 2020] ksmbd: handle_startup_event:370: Reconnect to a new user space daemon
[Thu Jul 9 21:17:00 2020] ksmbd: handle_startup_event:370: Reconnect to a new user space daemon
[Thu Jul 9 21:17:06 2020] ksmbd: handle_startup_event:370: Reconnect to a new user space daemon
[Thu Jul 9 21:17:07 2020] ksmbd: create_smb2_pipe:1815: Unable to open RPC pipe: -22
[Thu Jul 9 21:17:07 2020] ksmbd: create_smb2_pipe:1815: Unable to open RPC pipe: -22
[Thu Jul 9 21:17:07 2020] ksmbd: create_smb2_pipe:1815: Unable to open RPC pipe: -22
[Thu Jul 9 21:17:07 2020] ksmbd: create_smb2_pipe:1815: Unable to open RPC pipe: -22
[Thu Jul 9 21:17:07 2020] ksmbd: create_smb2_pipe:1815: Unable to open RPC pipe: -22
[Thu Jul 9 21:17:07 2020] ksmbd: create_smb2_pipe:1815: Unable to open RPC pipe: -22
[Thu Jul 9 21:17:08 2020] ksmbd: create_smb2_pipe:1815: Unable to open RPC pipe: -22
[Thu Jul 9 21:17:08 2020] ksmbd: create_smb2_pipe:1815: Unable to open RPC pipe: -22
[Thu Jul 9 21:17:08 2020] ksmbd: handle_startup_event:370: Reconnect to a new user space daemon
[Fri Jul 10 20:34:47 2020] ksmbd: handle_startup_event:370: Reconnect to a new user space daemon
[Fri Jul 10 20:34:52 2020] ksmbd: handle_startup_event:370: Reconnect to a new user space daemon
[Fri Jul 10 20:34:54 2020] ksmbd: handle_startup_event:370: Reconnect to a new user space daemon
[Fri Jul 10 20:35:00 2020] ksmbd: handle_startup_event:370: Reconnect to a new user space daemon
root@DD-WRT:~#
Joined: 06 Jun 2006 Posts: 7463 Location: Dresden, Germany
Posted: Fri Jul 10, 2020 13:06 Post subject:
wenzhuo wrote:
BrainSlayer wrote:
some further info. the version i posted fixes a important issue. min server and max server protocol was never working due a wrong server parameter i used. this is now fixed. if you set min protocol and max protocol to 3.1.1 it will never work with windows 10. according to my findings windows 10 only works if smb2 is supported at minimum, but will connect with 3.1.1 of course. but it always checks for smb2 first and will fail if smb2 is not supported
According to smb.conf(5), 'min protocol' is a synonym for 'server min protocol', and 'max protocol' is a synonym for server max protocol. So this is not a problem.
Since I changed "min protocol" and "max protocol" to SMB2_02 and SMB2_10 respectively 3 days ago on my netgear wndr4300 running r43516, the router has been running fine and Windows 10 clients haven't experienced unrecoverable authentication failures when opening the shares requiring user authentication. Windows 10 still experiences recoverable glitches when opening them.
the alias is not supported by ksmbd. i changed the code in this test version to use "server min protocol". if you just use the alias is ignored and min is default smb 1.0 and max 3.1.1
in next official release it will be available for all platforms _________________ "So you tried to use the computer and it started smoking? Sounds like a Mac to me.." - Louis Rossmann https://www.youtube.com/watch?v=eL_5YDRWqGE&t=60s
Joined: 06 Jun 2006 Posts: 7463 Location: Dresden, Germany
Posted: Fri Jul 10, 2020 13:07 Post subject:
wenzhuo wrote:
FTR
Quote:
root@DD-WRT:~# dmesg | grep -i ksmbd | dmesg-uptime.awk
[Tue Jul 7 06:06:07 2020] ksmbd: kill command received
[Thu Jul 9 07:07:41 2020] ksmbd: handle_startup_event:370: Reconnect to a new user space daemon
[Thu Jul 9 21:17:00 2020] ksmbd: handle_startup_event:370: Reconnect to a new user space daemon
[Thu Jul 9 21:17:06 2020] ksmbd: handle_startup_event:370: Reconnect to a new user space daemon
[Thu Jul 9 21:17:07 2020] ksmbd: create_smb2_pipe:1815: Unable to open RPC pipe: -22
[Thu Jul 9 21:17:07 2020] ksmbd: create_smb2_pipe:1815: Unable to open RPC pipe: -22
[Thu Jul 9 21:17:07 2020] ksmbd: create_smb2_pipe:1815: Unable to open RPC pipe: -22
[Thu Jul 9 21:17:07 2020] ksmbd: create_smb2_pipe:1815: Unable to open RPC pipe: -22
[Thu Jul 9 21:17:07 2020] ksmbd: create_smb2_pipe:1815: Unable to open RPC pipe: -22
[Thu Jul 9 21:17:07 2020] ksmbd: create_smb2_pipe:1815: Unable to open RPC pipe: -22
[Thu Jul 9 21:17:08 2020] ksmbd: create_smb2_pipe:1815: Unable to open RPC pipe: -22
[Thu Jul 9 21:17:08 2020] ksmbd: create_smb2_pipe:1815: Unable to open RPC pipe: -22
[Thu Jul 9 21:17:08 2020] ksmbd: handle_startup_event:370: Reconnect to a new user space daemon
[Fri Jul 10 20:34:47 2020] ksmbd: handle_startup_event:370: Reconnect to a new user space daemon
[Fri Jul 10 20:34:52 2020] ksmbd: handle_startup_event:370: Reconnect to a new user space daemon
[Fri Jul 10 20:34:54 2020] ksmbd: handle_startup_event:370: Reconnect to a new user space daemon
[Fri Jul 10 20:35:00 2020] ksmbd: handle_startup_event:370: Reconnect to a new user space daemon
root@DD-WRT:~#
this can't be the latest test version since your device is running since more than 3 day's. consider that i posted a testversion for r7800 here which fixes all that problems _________________ "So you tried to use the computer and it started smoking? Sounds like a Mac to me.." - Louis Rossmann https://www.youtube.com/watch?v=eL_5YDRWqGE&t=60s
this can't be the latest test version since your device is running since more than 3 day's. consider that i posted a testversion for r7800 here which fixes all that problems
It is still on r43516. I downgraded it to r43516 after experiencing ksmbd kernel oops with r43652. Then I noticed ksmbd causes kernel panic too in r43516. After seeing your comments on SMB3_11, I changed the smb protocol to SMB2. It's weird that the protocol change also makes a difference on r43516.
Joined: 06 Jun 2006 Posts: 7463 Location: Dresden, Germany
Posted: Fri Jul 10, 2020 16:17 Post subject:
wenzhuo wrote:
BrainSlayer wrote:
this can't be the latest test version since your device is running since more than 3 day's. consider that i posted a testversion for r7800 here which fixes all that problems
It is still on r43516. I downgraded it to r43516 after experiencing ksmbd kernel oops with r43652. Then I noticed ksmbd causes kernel panic too in r43516. After seeing your comments on SMB3_11, I changed the smb protocol to SMB2. It's weird that the protocol change also makes a difference on r43516.
Cannot wait to test the unreleased build.
i can provide you a preview for the ea8500 later today. you can consider these issues as fixed. (hopefully) _________________ "So you tried to use the computer and it started smoking? Sounds like a Mac to me.." - Louis Rossmann https://www.youtube.com/watch?v=eL_5YDRWqGE&t=60s