Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Jan 2022 14:23:43 -0500
From:      Mark Saad <nonesuch@longcount.org>
To:        Rick Macklem <rmacklem@uoguelph.ca>
Cc:        Yuri <yuri@aetern.org>, Miroslav Lachman <000.fbsd@quip.cz>,  "freebsd-current@freebsd.org" <freebsd-current@freebsd.org>, freebsd-stable <freebsd-stable@freebsd.org>
Subject:   Re: Deprecating smbfs(5) and removing it before FreeBSD 14
Message-ID:  <CAMXt9NYbUn5fkmRory1ggfUMbgqJJyJz8sFqY=oqpThq5Hc_zg@mail.gmail.com>
In-Reply-To: <YQXPR0101MB0968BAB76CAEEB3A945512DCDD599@YQXPR0101MB0968.CANPRD01.PROD.OUTLOOK.COM>
References:  <CAPyFy2CJKxMQQKwD3N=MTe-P4KodN77e3YCEh4z0Ssf9sXWEcQ@mail.gmail.com> <6f99f9bc-8831-aefe-4f73-72f50f8f347b@aetern.org> <79402464-f9e6-5f56-645e-cfd49640032e@quip.cz> <YQXPR0101MB0968A28AAE84DF855AF5125CDD8A9@YQXPR0101MB0968.CANPRD01.PROD.OUTLOOK.COM> <7db04ed9-39eb-7163-ce92-9a52c5f7d302@quip.cz> <YQXPR0101MB096856C46CC68E39E1F8EFFCDD4F9@YQXPR0101MB0968.CANPRD01.PROD.OUTLOOK.COM> <54704b99-7b89-76a4-0368-79bee391926d@quip.cz> <YQXPR0101MB09681E68BAF66F8D8160D6C2DD599@YQXPR0101MB0968.CANPRD01.PROD.OUTLOOK.COM> <bf549f03-1947-fafb-c872-e78ea28ce32a@aetern.org> <YQXPR0101MB0968BAB76CAEEB3A945512DCDD599@YQXPR0101MB0968.CANPRD01.PROD.OUTLOOK.COM>

next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000220b6405d630ad13
Content-Type: text/plain; charset="UTF-8"

On Wed, Jan 19, 2022 at 7:04 PM Rick Macklem <rmacklem@uoguelph.ca> wrote:

> Yuri <yuri@aetern.org> wrote:
> > Rick Macklem wrote:
> > > I have downloaded the final version of the opensolaris
> > > smbfs and it looks much more reasonable to port to
> > > FreeBSD.
> >
> > What do you mean by "final version of the opensolaris smbfs", the one
> > from 2010?  Please note that illumos (actively maintained fork of
> > opensolaris) has a much more up to date one.
> I'm not surprised that illumos will have updates.
> I don't think it will affect the exercise at this time, since the current
> work
> is to figure out what pieces of the opensolaris code needs to be pulled
> into the current smbfs to make the newer version work.
> Solaris uses a very different VFS/VOP locking model, so a direct port
> of the opensolaris code would be more work than I will be attempting.
>
> rick
>
> > I will be starting to work on this (and maybe Mark Saad will be
> > able to help).
> >
> > I have no idea when I'll have code that can be tested by others.
> >
> > rick
> >
> > ________________________________________
> > From: Miroslav Lachman <000.fbsd@quip.cz>
> > Sent: Monday, January 10, 2022 10:27 AM
> > To: Rick Macklem; freebsd-current@freebsd.org; freebsd-stable
> > Cc: Yuri
> > Subject: Re: Deprecating smbfs(5) and removing it before FreeBSD 14
> >
> > CAUTION: This email originated from outside of the University of Guelph.
> Do not click links or open attachments unless you recognize the sender and
> know the content is safe. If in doubt, forward suspicious emails to
> IThelp@uoguelph.ca
> >
> >
> > Hello Rick,
> > thank you for the update and your time on smbfs. I hope OpenSolaris
> > version will be portable. (or mayby some older version from Apple?)
> > FreeBSD without possibility to mount smbfs is not an option for some
> > projects.
> >
> > Kind regards
> > Miroslav Lachman
> >
> >
> > On 09/01/2022 15:46, Rick Macklem wrote:
> >> Well, I took a look at the Apple code and I'm afraid I
> >> think porting it into FreeBSD is too big a job for me.
> >>
> >> I was hoping the code would have a layer that could
> >> be used as a "block box" for the VOP calls, but that
> >> does not seem to be the case.
> >> There is also a *lot* of code in it.
> >>
> >> I am going to look at the OpenSolaris code, to see if
> >> I think it will be an easier port.
> >>
> >> rick
> >>
> >> ________________________________________
> >> From: Miroslav Lachman <000.fbsd@quip.cz>
> >> Sent: Monday, November 1, 2021 5:47 PM
> >> To: Rick Macklem; freebsd-current@freebsd.org; freebsd-stable
> >> Cc: Yuri
> >> Subject: Re: Deprecating smbfs(5) and removing it before FreeBSD 14
> >>
> >> CAUTION: This email originated from outside of the University of
> Guelph. Do not click links or open attachments unless you recognize the
> sender and know the content is safe. If in doubt, forward suspicious emails
> to IThelp@uoguelph.ca
> >>
> >>
> >> On 01/11/2021 16:55, Rick Macklem wrote:
> >>> Miroslav Lachman wrote:
> >>> [good stuff snipped]
> >>>> Apple sources can be found there
> >>>> https://opensource.apple.com/source/smb/ with all the history from
> SMBv1
> >>>> to SMBv3. The files have original copyright header from 2001 Boris
> Popov
> >>>> (same as FreeBSD) but otherwise it is very different code due to
> >>>> different kernel interfaces and so on.
> >>>> With Apple and Illumos sources it is possible to have smbfs in FreeBSD
> >>>> upgraded to v2 or v3 but very skilled programmer is needed for this
> >>>> work. And for the past years there is none interested in this work.
> >>>
> >>> Although I agree that it would be a non-trivial exercise, a lot of the
> Apple
> >>> differences are in the "smoke and mirrors" category.
> >>> Around OSX 10.4, they changed their VFS/VOP to typedefs and accessor
> >>> functions. For example:
> >>>          "struct vnode *vp" became "vnode_t vp"
> >>> and "vp->v_type" became "vnode_type(vp)"
> >>>
> >>> Ten years ago, the actual semantics were very close to what FreeBSD
> used.
> >>> If you look at sys/fs/nfs/nfskpiport.h in older sources (around
> FreeBSD 10),
> >>> you'll see a bunch of macros I used to allow the Apple port to also
> build/run
> >>> on FreeBSD (a couple, such as vnode_t are still left because I've
> never gotten
> >>> around to doing the edit to replace them).
> >>
> >> If I see it right even the 10 years old Apple version of smbfs has
> >> support for SMBv2 so if this old version is closer to FreeBSD kernel /
> >> smbfs it can be a good starting point to merge changes to our smbfs to
> >> have SMBv2 support on FreeBSD.
> >>
> >>> The hard part will be dealing with the actual VFS/VOP semantics
> changes that
> >>> have occurred in the last 10 years.
> >>>
> >>> Did they stick APSLs on the files? (If so, I think it could still be
> ok, since the APSL
> >>> is a lot like the CDDL. However, I'm not sure if the APSL has ever
> been blessed
> >>> by FreeBSD as of yet?)
> >>
> >> The old versions of smbfs has original copyright header and no other
> >> license. Newer version has some added files with different header with
> >> APSL license. For example
> >>
> https://opensource.apple.com/source/smb/smb-759.40.1/kernel/smbfs/smbfs_subr_2.h.auto.html
> >>
> >> If license is a problem then I think it can live with APSL in the ports
> >> tree as a loadable kernel module. Maybe this will be the easier for
> >> development too?
> >>
> >>> Don't assume anything will happen, but I *might* take a look in the
> winter,
> >>> since outstanding NFS changes should be done by the end of 2021.
> >>
> >> I really appreciate your endless work on NFS on FreeBSD. Without your
> >> work the NFS will be lacking behind industry standards similar to what
> >> we see with smbfs.
> >> And if you will have some spare time to take a look on smbfs and maybe
> >> solve the SMBv2 / SMBv3 problem you will be my hero. I am waiting for it
> >> for many years and I know I am not alone who needs working SMB / CIFS on
> >> FreeBSD.
> >>
> >>> It does sound like there is some interest in this and that fuse
> doesn't solve
> >>> the problem (at least for everyone).
> >>
> >> Yes, there is an interest. It was discussed few times in the past in the
> >> mailing lists and web forums.freebsd.org but without anybody willing to
> >> touch the code.
> >> FUSE alternatives have so many problems with performance, stability and
> >> configuration.
> >> https://forums.freebsd.org/threads/getting-smbnetfs-to-work.78413/
> >>
> >> Kind regards
> >> Miroslav Lachman
> >>
> >
>
>
>
So I am looking at the Apple and Solaris code, provided by rick. I am not
sure if the illumos code provides SMB2 support. They based the solaris code
on Apple SMB-217.x which is from OSX 10.4 . Which I am sure predates smb2 .

https://github.com/apple-oss-distributions/smb/tree/smb-217.19

If I am following this correctly we need to look at Apple's smb client from
OSX 10.9  which is where I start to see bits about smb2

https://github.com/apple-oss-distributions/smb/tree/smb-697.95.1/kernel/netsmb


This is also where this stuff starts to look less and less like FreeBSD .
Let me ask some of the illumos people I know to see if there is anything
they can point to.



-- 
mark saad | nonesuch@longcount.org

--000000000000220b6405d630ad13
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Wed, Jan 19, 2022 at 7:04 PM Rick =
Macklem &lt;<a href=3D"mailto:rmacklem@uoguelph.ca">rmacklem@uoguelph.ca</a=
>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px=
 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Yur=
i &lt;<a href=3D"mailto:yuri@aetern.org" target=3D"_blank">yuri@aetern.org<=
/a>&gt; wrote:<br>
&gt; Rick Macklem wrote:<br>
&gt; &gt; I have downloaded the final version of the opensolaris<br>
&gt; &gt; smbfs and it looks much more reasonable to port to<br>
&gt; &gt; FreeBSD.<br>
&gt;<br>
&gt; What do you mean by &quot;final version of the opensolaris smbfs&quot;=
, the one<br>
&gt; from 2010?=C2=A0 Please note that illumos (actively maintained fork of=
<br>
&gt; opensolaris) has a much more up to date one.<br>
I&#39;m not surprised that illumos will have updates.<br>
I don&#39;t think it will affect the exercise at this time, since the curre=
nt work<br>
is to figure out what pieces of the opensolaris code needs to be pulled<br>
into the current smbfs to make the newer version work.<br>
Solaris uses a very different VFS/VOP locking model, so a direct port<br>
of the opensolaris code would be more work than I will be attempting.<br>
<br>
rick<br>
<br>
&gt; I will be starting to work on this (and maybe Mark Saad will be<br>
&gt; able to help).<br>
&gt;<br>
&gt; I have no idea when I&#39;ll have code that can be tested by others.<b=
r>
&gt;<br>
&gt; rick<br>
&gt;<br>
&gt; ________________________________________<br>
&gt; From: Miroslav Lachman &lt;<a href=3D"mailto:000.fbsd@quip.cz" target=
=3D"_blank">000.fbsd@quip.cz</a>&gt;<br>
&gt; Sent: Monday, January 10, 2022 10:27 AM<br>
&gt; To: Rick Macklem; <a href=3D"mailto:freebsd-current@freebsd.org" targe=
t=3D"_blank">freebsd-current@freebsd.org</a>; freebsd-stable<br>
&gt; Cc: Yuri<br>
&gt; Subject: Re: Deprecating smbfs(5) and removing it before FreeBSD 14<br=
>
&gt;<br>
&gt; CAUTION: This email originated from outside of the University of Guelp=
h. Do not click links or open attachments unless you recognize the sender a=
nd know the content is safe. If in doubt, forward suspicious emails to <a h=
ref=3D"mailto:IThelp@uoguelph.ca" target=3D"_blank">IThelp@uoguelph.ca</a><=
br>
&gt;<br>
&gt;<br>
&gt; Hello Rick,<br>
&gt; thank you for the update and your time on smbfs. I hope OpenSolaris<br=
>
&gt; version will be portable. (or mayby some older version from Apple?)<br=
>
&gt; FreeBSD without possibility to mount smbfs is not an option for some<b=
r>
&gt; projects.<br>
&gt;<br>
&gt; Kind regards<br>
&gt; Miroslav Lachman<br>
&gt;<br>
&gt;<br>
&gt; On 09/01/2022 15:46, Rick Macklem wrote:<br>
&gt;&gt; Well, I took a look at the Apple code and I&#39;m afraid I<br>
&gt;&gt; think porting it into FreeBSD is too big a job for me.<br>
&gt;&gt;<br>
&gt;&gt; I was hoping the code would have a layer that could<br>
&gt;&gt; be used as a &quot;block box&quot; for the VOP calls, but that<br>
&gt;&gt; does not seem to be the case.<br>
&gt;&gt; There is also a *lot* of code in it.<br>
&gt;&gt;<br>
&gt;&gt; I am going to look at the OpenSolaris code, to see if<br>
&gt;&gt; I think it will be an easier port.<br>
&gt;&gt;<br>
&gt;&gt; rick<br>
&gt;&gt;<br>
&gt;&gt; ________________________________________<br>
&gt;&gt; From: Miroslav Lachman &lt;<a href=3D"mailto:000.fbsd@quip.cz" tar=
get=3D"_blank">000.fbsd@quip.cz</a>&gt;<br>
&gt;&gt; Sent: Monday, November 1, 2021 5:47 PM<br>
&gt;&gt; To: Rick Macklem; <a href=3D"mailto:freebsd-current@freebsd.org" t=
arget=3D"_blank">freebsd-current@freebsd.org</a>; freebsd-stable<br>
&gt;&gt; Cc: Yuri<br>
&gt;&gt; Subject: Re: Deprecating smbfs(5) and removing it before FreeBSD 1=
4<br>
&gt;&gt;<br>
&gt;&gt; CAUTION: This email originated from outside of the University of G=
uelph. Do not click links or open attachments unless you recognize the send=
er and know the content is safe. If in doubt, forward suspicious emails to =
<a href=3D"mailto:IThelp@uoguelph.ca" target=3D"_blank">IThelp@uoguelph.ca<=
/a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On 01/11/2021 16:55, Rick Macklem wrote:<br>
&gt;&gt;&gt; Miroslav Lachman wrote:<br>
&gt;&gt;&gt; [good stuff snipped]<br>
&gt;&gt;&gt;&gt; Apple sources can be found there<br>
&gt;&gt;&gt;&gt; <a href=3D"https://opensource.apple.com/source/smb/" rel=
=3D"noreferrer" target=3D"_blank">https://opensource.apple.com/source/smb/<=
/a> with all the history from SMBv1<br>
&gt;&gt;&gt;&gt; to SMBv3. The files have original copyright header from 20=
01 Boris Popov<br>
&gt;&gt;&gt;&gt; (same as FreeBSD) but otherwise it is very different code =
due to<br>
&gt;&gt;&gt;&gt; different kernel interfaces and so on.<br>
&gt;&gt;&gt;&gt; With Apple and Illumos sources it is possible to have smbf=
s in FreeBSD<br>
&gt;&gt;&gt;&gt; upgraded to v2 or v3 but very skilled programmer is needed=
 for this<br>
&gt;&gt;&gt;&gt; work. And for the past years there is none interested in t=
his work.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Although I agree that it would be a non-trivial exercise, a lo=
t of the Apple<br>
&gt;&gt;&gt; differences are in the &quot;smoke and mirrors&quot; category.=
<br>
&gt;&gt;&gt; Around OSX 10.4, they changed their VFS/VOP to typedefs and ac=
cessor<br>
&gt;&gt;&gt; functions. For example:<br>
&gt;&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;struct vnode *vp&quot;=
 became &quot;vnode_t vp&quot;<br>
&gt;&gt;&gt; and &quot;vp-&gt;v_type&quot; became &quot;vnode_type(vp)&quot=
;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Ten years ago, the actual semantics were very close to what Fr=
eeBSD used.<br>
&gt;&gt;&gt; If you look at sys/fs/nfs/nfskpiport.h in older sources (aroun=
d FreeBSD 10),<br>
&gt;&gt;&gt; you&#39;ll see a bunch of macros I used to allow the Apple por=
t to also build/run<br>
&gt;&gt;&gt; on FreeBSD (a couple, such as vnode_t are still left because I=
&#39;ve never gotten<br>
&gt;&gt;&gt; around to doing the edit to replace them).<br>
&gt;&gt;<br>
&gt;&gt; If I see it right even the 10 years old Apple version of smbfs has=
<br>
&gt;&gt; support for SMBv2 so if this old version is closer to FreeBSD kern=
el /<br>
&gt;&gt; smbfs it can be a good starting point to merge changes to our smbf=
s to<br>
&gt;&gt; have SMBv2 support on FreeBSD.<br>
&gt;&gt;<br>
&gt;&gt;&gt; The hard part will be dealing with the actual VFS/VOP semantic=
s changes that<br>
&gt;&gt;&gt; have occurred in the last 10 years.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Did they stick APSLs on the files? (If so, I think it could st=
ill be ok, since the APSL<br>
&gt;&gt;&gt; is a lot like the CDDL. However, I&#39;m not sure if the APSL =
has ever been blessed<br>
&gt;&gt;&gt; by FreeBSD as of yet?)<br>
&gt;&gt;<br>
&gt;&gt; The old versions of smbfs has original copyright header and no oth=
er<br>
&gt;&gt; license. Newer version has some added files with different header =
with<br>
&gt;&gt; APSL license. For example<br>
&gt;&gt; <a href=3D"https://opensource.apple.com/source/smb/smb-759.40.1/ke=
rnel/smbfs/smbfs_subr_2.h.auto.html" rel=3D"noreferrer" target=3D"_blank">h=
ttps://opensource.apple.com/source/smb/smb-759.40.1/kernel/smbfs/smbfs_subr=
_2.h.auto.html</a><br>
&gt;&gt;<br>
&gt;&gt; If license is a problem then I think it can live with APSL in the =
ports<br>
&gt;&gt; tree as a loadable kernel module. Maybe this will be the easier fo=
r<br>
&gt;&gt; development too?<br>
&gt;&gt;<br>
&gt;&gt;&gt; Don&#39;t assume anything will happen, but I *might* take a lo=
ok in the winter,<br>
&gt;&gt;&gt; since outstanding NFS changes should be done by the end of 202=
1.<br>
&gt;&gt;<br>
&gt;&gt; I really appreciate your endless work on NFS on FreeBSD. Without y=
our<br>
&gt;&gt; work the NFS will be lacking behind industry standards similar to =
what<br>
&gt;&gt; we see with smbfs.<br>
&gt;&gt; And if you will have some spare time to take a look on smbfs and m=
aybe<br>
&gt;&gt; solve the SMBv2 / SMBv3 problem you will be my hero. I am waiting =
for it<br>
&gt;&gt; for many years and I know I am not alone who needs working SMB / C=
IFS on<br>
&gt;&gt; FreeBSD.<br>
&gt;&gt;<br>
&gt;&gt;&gt; It does sound like there is some interest in this and that fus=
e doesn&#39;t solve<br>
&gt;&gt;&gt; the problem (at least for everyone).<br>
&gt;&gt;<br>
&gt;&gt; Yes, there is an interest. It was discussed few times in the past =
in the<br>
&gt;&gt; mailing lists and web <a href=3D"http://forums.freebsd.org" rel=3D=
"noreferrer" target=3D"_blank">forums.freebsd.org</a> but without anybody w=
illing to<br>
&gt;&gt; touch the code.<br>
&gt;&gt; FUSE alternatives have so many problems with performance, stabilit=
y and<br>
&gt;&gt; configuration.<br>
&gt;&gt; <a href=3D"https://forums.freebsd.org/threads/getting-smbnetfs-to-=
work.78413/" rel=3D"noreferrer" target=3D"_blank">https://forums.freebsd.or=
g/threads/getting-smbnetfs-to-work.78413/</a><br>
&gt;&gt;<br>
&gt;&gt; Kind regards<br>
&gt;&gt; Miroslav Lachman<br>
&gt;&gt;<br>
&gt;<br>
<br>
<br></blockquote><div><br></div><div>So I am looking at the Apple and Solar=
is code, provided by rick. I am not sure if the illumos code provides SMB2 =
support. They based the solaris code on Apple SMB-217.x which is from OSX 1=
0.4 . Which I am sure predates smb2 . <br></div><div><br></div><div><a href=
=3D"https://github.com/apple-oss-distributions/smb/tree/smb-217.19">https:/=
/github.com/apple-oss-distributions/smb/tree/smb-217.19</a> </div></div><di=
v><br></div><div></div><div>If I am following this correctly we need to loo=
k at Apple&#39;s smb client from OSX 10.9=C2=A0 which is where I start to s=
ee bits about smb2 <br></div><div><br></div><div><a href=3D"https://github.=
com/apple-oss-distributions/smb/tree/smb-697.95.1/kernel/netsmb">https://gi=
thub.com/apple-oss-distributions/smb/tree/smb-697.95.1/kernel/netsmb</a>=C2=
=A0=C2=A0</div><div><br></div><div>This is also where this stuff starts to =
look less and less like FreeBSD .=C2=A0=C2=A0 Let me ask some of the illumo=
s people I know to see if there is anything they can point to.<br></div><di=
v><br></div><div><br></div><div><br></div>-- <br><div dir=3D"ltr" class=3D"=
gmail_signature">mark saad | <a href=3D"mailto:nonesuch@longcount.org" targ=
et=3D"_blank">nonesuch@longcount.org</a><br></div></div>

--000000000000220b6405d630ad13--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAMXt9NYbUn5fkmRory1ggfUMbgqJJyJz8sFqY=oqpThq5Hc_zg>