All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] cifsd: introduce SMB3 kernel server
@ 2021-03-18 13:12 Dan Carpenter
       [not found] ` <CAH2r5msOBAho=1W-eY0paj+4P1J+tuw-vFaRGg8oY50dXu6MHQ@mail.gmail.com>
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Dan Carpenter @ 2021-03-18 13:12 UTC (permalink / raw)
  To: namjae.jeon; +Cc: linux-cifs

[ The fs/cifsd/ directory needs to be added to the MAINTAINERS file
  so this stuff goes through linux-cifs@vger.kernel.org ]

Hello Namjae Jeon,

The patch cabcebc31de4: "cifsd: introduce SMB3 kernel server" from
May 14, 2020, leads to the following static checker warning:

	fs/cifsd/transport_rdma.c:1168 smb_direct_post_send_data()
	warn: missing error code 'ret'

fs/cifsd/transport_rdma.c
  1150  
  1151          ret = smb_direct_create_header(t, data_length, remaining_data_length,
  1152                                         &msg);
  1153          if (ret) {
  1154                  atomic_inc(&t->send_credits);
  1155                  return ret;
  1156          }

"ret" is zero.

  1157  
  1158          for (i = 0; i < niov; i++) {
  1159                  struct ib_sge *sge;
  1160                  int sg_cnt;
  1161  
  1162                  sg_init_table(sg, SMB_DIRECT_MAX_SEND_SGES-1);
  1163                  sg_cnt = get_mapped_sg_list(t->cm_id->device,
  1164                                  iov[i].iov_base, iov[i].iov_len,
  1165                                  sg, SMB_DIRECT_MAX_SEND_SGES-1, DMA_TO_DEVICE);
  1166                  if (sg_cnt <= 0) {
  1167                          ksmbd_err("failed to map buffer\n");
  1168                          goto err;

Should ret = -ENOMEM on this path?

  1169                  } else if (sg_cnt + msg->num_sge > SMB_DIRECT_MAX_SEND_SGES-1) {
  1170                          ksmbd_err("buffer not fitted into sges\n");
  1171                          ret = -E2BIG;
  1172                          ib_dma_unmap_sg(t->cm_id->device, sg, sg_cnt,
  1173                                          DMA_TO_DEVICE);
  1174                          goto err;
  1175                  }
  1176  
  1177                  for (j = 0; j < sg_cnt; j++) {
  1178                          sge = &msg->sge[msg->num_sge];
  1179                          sge->addr = sg_dma_address(&sg[j]);
  1180                          sge->length = sg_dma_len(&sg[j]);
  1181                          sge->lkey  = t->pd->local_dma_lkey;
  1182                          msg->num_sge++;
  1183                  }
  1184          }
  1185  
  1186          ret = post_sendmsg(t, send_ctx, msg);
  1187          if (ret)
  1188                  goto err;
  1189          return 0;
  1190  err:
  1191          smb_direct_free_sendmsg(t, msg);
  1192          atomic_inc(&t->send_credits);
  1193          return ret;
  1194  }

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [bug report] cifsd: introduce SMB3 kernel server
       [not found] ` <CAH2r5msOBAho=1W-eY0paj+4P1J+tuw-vFaRGg8oY50dXu6MHQ@mail.gmail.com>
@ 2021-03-19  8:11   ` Dan Carpenter
  0 siblings, 0 replies; 10+ messages in thread
From: Dan Carpenter @ 2021-03-19  8:11 UTC (permalink / raw)
  To: Steve French; +Cc: Namjae Jeon, CIFS

On Thu, Mar 18, 2021 at 12:58:11PM -0500, Steve French wrote:
> Is the maintainers entry he added recently ok?
> 
> https://github.com/smfrench/smb3-kernel/blob/ff4a5c2c2732f7b7790a2424e8927f8602e467b5/MAINTAINERS#L4447 
> 

Ah good.  It hadn't hit linux-next when I wrote these.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [bug report] cifsd: introduce SMB3 kernel server
  2021-03-18 13:12 [bug report] cifsd: introduce SMB3 kernel server Dan Carpenter
       [not found] ` <CAH2r5msOBAho=1W-eY0paj+4P1J+tuw-vFaRGg8oY50dXu6MHQ@mail.gmail.com>
@ 2021-03-19 13:12 ` Christoph Hellwig
  2021-03-19 15:07   ` Steve French
  2021-04-06  8:37 ` L. A. Walsh
  2 siblings, 1 reply; 10+ messages in thread
From: Christoph Hellwig @ 2021-03-19 13:12 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: namjae.jeon, linux-cifs

On Thu, Mar 18, 2021 at 04:12:17PM +0300, Dan Carpenter wrote:
> [ The fs/cifsd/ directory needs to be added to the MAINTAINERS file
>   so this stuff goes through linux-cifs@vger.kernel.org ]

Err, how did this hit linux-next?  I've never even seen the code posted
to a mailing list.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [bug report] cifsd: introduce SMB3 kernel server
  2021-03-19 13:12 ` Christoph Hellwig
@ 2021-03-19 15:07   ` Steve French
  2021-03-19 15:21     ` Christoph Hellwig
  0 siblings, 1 reply; 10+ messages in thread
From: Steve French @ 2021-03-19 15:07 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Dan Carpenter, Namjae Jeon, CIFS

Namjae was working on a better high level summary of status so I would
expect to see a better description of that posted soon.  They also
restructured the patch set into a smaller set since rereviewing years
of their incremental patches would be far more time consuming.  It has
been presented over the past year or so at various conferences.
Although he had done a good job presenting on cifsd at the big Storage
Developer Conference last year (and also SambaXP etc.), a lot had
improved recently (e.g. it already passes more xfstests than many
servers).  There have been posts about cifsd on samba-technical and
linux-cifs where issues overlapped (e.g. compatibility with attributes
that Samba currently saves as xattrs) so the project is well known at
least among the samba community (and apparently it is commonly shipped
in various embedded devices already).   There is also a public mailing
list for the project so some of the discussion among the core group of
developers working on it most is probably on that.

I have been focused on testing it with Linux client.  See e.g. the run
from a couple days ago

     http://smb3-test-rhel-75.southcentralus.cloudapp.azure.com/#/builders/8/builds/26

and I have been pleasantly surprised at the progress, and have been
trying to make sure the test results are very visible, but as Ronnie
and others have mentioned, cifsd has already been very very useful for
testing the client (Samba is harder to tweak for testing).

On Fri, Mar 19, 2021 at 8:14 AM Christoph Hellwig <hch@infradead.org> wrote:
>
> On Thu, Mar 18, 2021 at 04:12:17PM +0300, Dan Carpenter wrote:
> > [ The fs/cifsd/ directory needs to be added to the MAINTAINERS file
> >   so this stuff goes through linux-cifs@vger.kernel.org ]
>
> Err, how did this hit linux-next?  I've never even seen the code posted
> to a mailing list.



-- 
Thanks,

Steve

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [bug report] cifsd: introduce SMB3 kernel server
  2021-03-19 15:07   ` Steve French
@ 2021-03-19 15:21     ` Christoph Hellwig
  2021-03-19 15:27       ` Steve French
  0 siblings, 1 reply; 10+ messages in thread
From: Christoph Hellwig @ 2021-03-19 15:21 UTC (permalink / raw)
  To: Steve French; +Cc: Christoph Hellwig, Dan Carpenter, Namjae Jeon, CIFS

Code that goes into linux-next needs to be posted to the relevant
lists, which in this case includes linux-fsdevel and linux-kernel.  No
backstory of conference and internal trees replaces that in any way.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [bug report] cifsd: introduce SMB3 kernel server
  2021-03-19 15:21     ` Christoph Hellwig
@ 2021-03-19 15:27       ` Steve French
  0 siblings, 0 replies; 10+ messages in thread
From: Steve French @ 2021-03-19 15:27 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Dan Carpenter, Namjae Jeon, CIFS

On Fri, Mar 19, 2021 at 10:21 AM Christoph Hellwig <hch@infradead.org> wrote:
>
> Code that goes into linux-next needs to be posted to the relevant
> lists, which in this case includes linux-fsdevel and linux-kernel.  No
> backstory of conference and internal trees replaces that in any way.

Yes - agree.

When I last talked with Namjae (and looks like he asked others for
opinions as well
how to restructure the patch series to be easier to review on
linux-fsdevel), the
plan was to send the patches to fsdevel as the smaller set (same as just
went in linux-next) ASAP, but he just finished an important piece of the
description (the updated protocol feature implementation summary) last
night which
he asked me (and probably others) to review before sending it out.

-- 
Thanks,

Steve

^ permalink raw reply	[flat|nested] 10+ messages in thread

* cifsd: introduce SMB3 kernel server
  2021-03-18 13:12 [bug report] cifsd: introduce SMB3 kernel server Dan Carpenter
       [not found] ` <CAH2r5msOBAho=1W-eY0paj+4P1J+tuw-vFaRGg8oY50dXu6MHQ@mail.gmail.com>
  2021-03-19 13:12 ` Christoph Hellwig
@ 2021-04-06  8:37 ` L. A. Walsh
  2021-04-06 10:14   ` Aurélien Aptel
  2 siblings, 1 reply; 10+ messages in thread
From: L. A. Walsh @ 2021-04-06  8:37 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: namjae.jeon, linux-cifs

On 2021/03/18 06:12, Dan Carpenter wrote:
> [ cifsd: introduce SMB3 kernel server"
Is it to be Linux policy that it will give in-kernel
support for only for smb3, or is it planned to move the rest of the proto
into the kernel as well?  It sorta seems like earlier parts of the protocol,
still dominant on home networks, though it seems linux not supporting
all of linux's smb devices, from smb2.1 and before.

I'm sure those clients would benefit as well, being kernel services
could allow for a lower latency with potentially faster response
time from being a kernel service instead of user-mode client?
Is that also planned?  Isn't the base of an smb3 server the same functions
of an smb2.x server with the new smb3 extensions?

Thanks!



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: cifsd: introduce SMB3 kernel server
  2021-04-06  8:37 ` L. A. Walsh
@ 2021-04-06 10:14   ` Aurélien Aptel
  2021-04-06 22:55     ` cifsd: introduce <SMB2n3> " L. A. Walsh
  0 siblings, 1 reply; 10+ messages in thread
From: Aurélien Aptel @ 2021-04-06 10:14 UTC (permalink / raw)
  To: L. A. Walsh, Dan Carpenter; +Cc: namjae.jeon, linux-cifs

"L. A. Walsh" <linux-cifs@tlinx.org> writes:
> On 2021/03/18 06:12, Dan Carpenter wrote:
>> [ cifsd: introduce SMB3 kernel server"
> Is it to be Linux policy that it will give in-kernel
> support for only for smb3, or is it planned to move the rest of the proto
> into the kernel as well?  It sorta seems like earlier parts of the protocol,
> still dominant on home networks, though it seems linux not supporting
> all of linux's smb devices, from smb2.1 and before.

smb1 (aka cifs) is unsecure, out of support and being actively
deprecated for over 10 years. Microsoft is uninstalling the smb1 server
on Windows updates. That's how hard they want to kill it. Samba is
planning to drop smb1 too eventually.

https://aka.ms/stopusingsmb1
https://aka.ms/smb1rs3

> I'm sure those clients would benefit as well, being kernel services
> could allow for a lower latency with potentially faster response
> time from being a kernel service instead of user-mode client?
> Is that also planned?  Isn't the base of an smb3 server the same functions
> of an smb2.x server with the new smb3 extensions?

AFAICT Namjae's ksmbd support smb2 and above.

Cheers,
-- 
Aurélien Aptel / SUSE Labs Samba Team
GPG: 1839 CB5F 9F5B FB9B AA97  8C99 03C8 A49B 521B D5D3
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg, DE
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 247165 (AG München)


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: cifsd: introduce <SMB2n3> kernel server
  2021-04-06 10:14   ` Aurélien Aptel
@ 2021-04-06 22:55     ` L. A. Walsh
  2021-04-06 23:32       ` Namjae Jeon
  0 siblings, 1 reply; 10+ messages in thread
From: L. A. Walsh @ 2021-04-06 22:55 UTC (permalink / raw)
  To: Aurélien Aptel; +Cc: Dan Carpenter, namjae.jeon, linux-cifs

On 2021/04/06 03:14, Aurélien Aptel wrote:
> "L. A. Walsh" <linux-cifs@tlinx.org> writes:
>   
>> On 2021/03/18 06:12, Dan Carpenter wrote:
>>     
>>> [ cifsd: introduce SMB3 kernel server"
>>>       
>> Is it to be Linux policy that it will give in-kernel
>> support for only for smb3, or is it planned to move the rest of the proto
>> into the kernel as well?  It sorta seems like earlier parts of the protocol,
>> still dominant on home networks, though it seems linux not supporting
>> all of linux's smb devices, from smb2.1 and before.
>>     
>
> smb1 (aka cifs) is unsecure, out of support and being actively
> deprecated for over 10 years. Microsoft is uninstalling the smb1 server
> on Windows updates. That's how hard they want to kill it. Samba is
> planning to drop smb1 too eventually.
>   
Dropping Smb1 support for linux-serving would seem to be a reasonable
step, since I would be hard-pressed to find a client that still
only talked Smb1 (clients from XP-era).

I am more concerned about the more secure smb2 & smb2.1 dialects. 
I have heard there is a security difference even between 2 & 2.1,
though, I don't often see a breakout between 2.0(only)+2.1, with both
seeming to be lumped in under Smb2. 

So lets say dropping smb1 isn't an issue...
>
>   
>> Isn't the base of an smb3 server the same functions
>> of an smb2.x server with the new smb3 extensions?
>>     
>
> AFAICT Namjae's ksmbd support smb2 and above.
>   
---
    Then would it be a problem if it is called something like
"smb2n3" so it can be readily understood to support both?

    It's just a small comfort issue, since 'smb3' really doesn't
seem to be very convincing about its smb2-support.

> Cheers,
>   
Likewise!



^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: cifsd: introduce <SMB2n3> kernel server
  2021-04-06 22:55     ` cifsd: introduce <SMB2n3> " L. A. Walsh
@ 2021-04-06 23:32       ` Namjae Jeon
  0 siblings, 0 replies; 10+ messages in thread
From: Namjae Jeon @ 2021-04-06 23:32 UTC (permalink / raw)
  To: 'L. A. Walsh'
  Cc: 'Dan Carpenter', linux-cifs, 'Aurélien Aptel'

> 
> On 2021/04/06 03:14, Aurélien Aptel wrote:
> > "L. A. Walsh" <linux-cifs@tlinx.org> writes:
> >
> >> On 2021/03/18 06:12, Dan Carpenter wrote:
> >>
> >>> [ cifsd: introduce SMB3 kernel server"
> >>>
> >> Is it to be Linux policy that it will give in-kernel support for only
> >> for smb3, or is it planned to move the rest of the proto into the
> >> kernel as well?  It sorta seems like earlier parts of the protocol,
> >> still dominant on home networks, though it seems linux not supporting
> >> all of linux's smb devices, from smb2.1 and before.
> >>
> >
> > smb1 (aka cifs) is unsecure, out of support and being actively
> > deprecated for over 10 years. Microsoft is uninstalling the smb1
> > server on Windows updates. That's how hard they want to kill it. Samba
> > is planning to drop smb1 too eventually.
> >
> Dropping Smb1 support for linux-serving would seem to be a reasonable step, since I would be hard-
> pressed to find a client that still only talked Smb1 (clients from XP-era).
> 
> I am more concerned about the more secure smb2 & smb2.1 dialects.
> I have heard there is a security difference even between 2 & 2.1, though, I don't often see a breakout
> between 2.0(only)+2.1, with both seeming to be lumped in under Smb2.
> 
> So lets say dropping smb1 isn't an issue...
> >
> >
> >> Isn't the base of an smb3 server the same functions of an smb2.x
> >> server with the new smb3 extensions?
> >>
> >
> > AFAICT Namjae's ksmbd support smb2 and above.
> >
> ---
>     Then would it be a problem if it is called something like "smb2n3" so it can be readily understood
> to support both?
> 
>     It's just a small comfort issue, since 'smb3' really doesn't seem to be very convincing about its
> smb2-support.
You probably didn't check the cover letter of ksmbd patch series. Supported dialects was specified in it.
See:
  https://www.spinics.net/lists/linux-cifs/msg21154.html
Well, It seems unnecessary to rename subject that is more difficult to understand because it is specified
in the document and cover letter.

Thanks!
> 
> > Cheers,
> >
> Likewise!
> 




^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-04-06 23:32 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-18 13:12 [bug report] cifsd: introduce SMB3 kernel server Dan Carpenter
     [not found] ` <CAH2r5msOBAho=1W-eY0paj+4P1J+tuw-vFaRGg8oY50dXu6MHQ@mail.gmail.com>
2021-03-19  8:11   ` Dan Carpenter
2021-03-19 13:12 ` Christoph Hellwig
2021-03-19 15:07   ` Steve French
2021-03-19 15:21     ` Christoph Hellwig
2021-03-19 15:27       ` Steve French
2021-04-06  8:37 ` L. A. Walsh
2021-04-06 10:14   ` Aurélien Aptel
2021-04-06 22:55     ` cifsd: introduce <SMB2n3> " L. A. Walsh
2021-04-06 23:32       ` Namjae Jeon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.