From: Stefan Metzmacher <metze@samba.org>
To: Namjae Jeon <linkinjeon@kernel.org>,
Namjae Jeon <namjae.jeon@samsung.com>,
linux-cifsd-devel@lists.sourceforge.net,
Samba Technical <samba-technical@lists.samba.org>,
Linux API Mailing List <linux-api@vger.kernel.org>,
"linux-cifs@vger.kernel.org" <linux-cifs@vger.kernel.org>
Subject: RFC: ksmbd ABI for ksmbd-tools...
Date: Fri, 12 Feb 2021 15:38:00 +0100 [thread overview]
Message-ID: <adf41e69-5915-06aa-6f8b-8ffc073fc8a7@samba.org> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 2800 bytes --]
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:
'/sys/class/ksmbd-control/<pid-of-ksmbd.mountd>/kill_server' would be better
(if it's needed at all).
I also have ideas how ksmbd{.ok,.mountd} could make use of Samba's winbindd (or authentication)
and Samba's rpc services, but this would require a few changes in the netlink protocol
between ksmbd.ko and ksmbd.mountd. It would be great if a Samba smb.conf option could
cause smbd to start ksmbd.mountd in the background and delegate all raw SMB handling
to the kernel.
So my main big question is how stable would the userspace interface to ksmbd.ko be
treated?
Would it be possible to change the netlink protocol or /sys/class/* behavior in future
in order to improve things?
Can we require that the userspace tool matches the kernel version for a while?
I think iproute2 creates a version for each stable kernel tree and tools like
bpftool, perf even come with each single kernel release.
While others like 'cifs.upcall' try to work with any kernel version.
What do others think?
metze
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next reply other threads:[~2021-02-12 14:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-12 14:38 Stefan Metzmacher [this message]
2021-02-13 2:06 ` [Linux-cifsd-devel] RFC: ksmbd ABI for ksmbd-tools Sergey Senozhatsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=adf41e69-5915-06aa-6f8b-8ffc073fc8a7@samba.org \
--to=metze@samba.org \
--cc=linkinjeon@kernel.org \
--cc=linux-api@vger.kernel.org \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-cifsd-devel@lists.sourceforge.net \
--cc=namjae.jeon@samsung.com \
--cc=samba-technical@lists.samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).