S Stefan Metzmacher #
Message details and related content
Hi Namjae, I looked through the interfaces used between userspace (ksmbd.mountd and ksmbd.control) and the kernel module. After loading the ksmbd.ko module and calling 'ksmbd.mountd', I see the following related proceses/kernel-threads: 12200 ? I 0:00 [kworker/0:0-ksmbd-io] 12247 ? Ss 0:00 ksmbd.mountd 12248 ? S 0:00 ksmbd.mountd 12249 ? S 0:00 [ksmbd-lo] 12250 ? S 0:00 [ksmbd-enp0s3] 12251 ? S 0:00 [ksmbd-enp0s8] 12252 ? S 0:00 [ksmbd-enp0s9] 12253 ? S 0:00 [ksmbd-enp0s10] 12254 ? I< 0:00 [ksmbd-smb_direc] 12255 ? S 0:00 [ksmbd:38794] 12257 ? S 0:00 [ksmbd:51579] I haven't found the exact place, but ksmbd.mountd starts the kernel-part. ksmbd.mountd also acts as some kind of upcall, for the server part, that takes care of authentication and some basic DCERPC calls. I'm wondering why there are two separate ways to kill the running server, 'killall ksmbd.mountd' for the userspace part and 'ksmbd.control -s' (which is just a wrapper for 'echo -n "hard" > /sys/class/ksmbd-control/kill_server') to shutdown the server part. As it's not useful to run any of these two components on its own, so I'm wondering why there's no stronger relationship. As naive admin I'd assume that the kernel part would detect the exit of ksmbd.mountd and shutdown itself. It would also be great to bind to specific ip addresses instead of devices and allow to run more than one instance of ksmbd.mountd (with different config files and or within containers). That's why I think single global hardcoded path like '/sys/class/ksmbd-control/kill_server' should be avoided, something like: