Author Topic: Updated Samba Client  (Read 199436 times)

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2548
  • Karma: +200/-0
    • View Profile
Re: Updated Samba Client
« Reply #120 on: January 19, 2024, 09:40:23 pm »
  How do I view EA's? Is that something that can be done directly, or are you looking in a log file?

I'm just using dir from the command line, noticed (by chance) that some files that I knew had EA's  were showing as 0 size.

I'll try investigate this weekend.  Heading out for lunch with my Dad today, and will probably end up consuming  too much red wine, so more likely a Sunday job :)

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2548
  • Karma: +200/-0
    • View Profile
Re: Updated Samba Client
« Reply #121 on: January 19, 2024, 09:59:32 pm »
Created:
https://mantis.smedley.id.au/view.php?id=780
https://mantis.smedley.id.au/view.php?id=781

For the issues in log files, and the log rotation issue.

Log rotation is a PITA  on OS/2 as on Unix you can rename an open file - on OS/2  we  have to close the file, rename  it,  and open a new one.

David McKenna

  • Hero Member
  • *****
  • Posts: 907
  • Karma: +36/-0
    • View Profile
Re: Updated Samba Client
« Reply #122 on: January 20, 2024, 02:22:38 pm »
Hey Paul,

@Dave -  an observation locally...
4.11 Server - EA's visible to client
4.18/4.19 Server - EA's not visible to client.

Same server smb.conf in use.  Do you see the same thing?  I wonder if this is part of the issue with the client.

Client *can* see EA's on a server running 4.18.x under Ubuntu.

 I tested this by copying a file (MP3) with EA's to the shared drive, then viewing on the command line. With server 4.19, as long as 'ea support = Yes' was in smb.conf on the server, I could see the EA's on the share. If set to 'No', then all EA's show '0'. EA support must be 'on' on the client to see EA's......

EDIT: But... It doesn't show the same value on the client that it shows directly on the server! There are many files with a small number of EA's (as seen on the server) that show '0' on the client, and the file I copied shows a larger EA number on the server than shows on the client. Strange...

EDIT2: But2... If I use server 4.11, I can see EA's larger than 0 on the client, but still smaller than what I see directly on the server. So it seems SAMBA does not display the total number of EA's (on the client) in either version 4.11 or 4.19, but shows more in 4.11.

Regards,
« Last Edit: January 20, 2024, 06:00:24 pm by David McKenna »

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2548
  • Karma: +200/-0
    • View Profile
Re: Updated Samba Client
« Reply #123 on: January 20, 2024, 11:25:24 pm »
EA fix is in https://smedley.id.au/tmp/smbd-4.19.4-20240121.zip -  turned out to be a missing patch from 4.11  - the source file changed name (trans.c  -> smb2_trans.c) and I missed the fact the patch was still required. Patch at https://github.com/psmedley/samba-os2/commit/677cfedea18c1acd2096a4e8d71167831290c768

@Dave it will be interesting to see if this helps  with the out of memory - part of the server was seeing that EA's were present,  then other parts  of the code weren't finding those EA's  - which could (in theory) lead to strange behaviour.
« Last Edit: January 20, 2024, 11:26:58 pm by Paul Smedley »

David McKenna

  • Hero Member
  • *****
  • Posts: 907
  • Karma: +36/-0
    • View Profile
Re: Updated Samba Client
« Reply #124 on: January 21, 2024, 01:23:54 am »
Thanks Paul,

 Unfortunately, I still eventually get the 'out of memory' error with this one. When I have both server and client set to allow EA's, I see a larger number for EA's with this one than the last one, but still smaller than what is on the server (and not quite the same value (slightly smaller) as with 4.11, but close).

 For example - the MP3 file I mentioned I copied from client to server earlier shows 488 for EA's on my client local drive, but shows 814 directly on the server after copying. With server 4.11, on the client share drive it shows 771 for EA's on that file, and with this latest 4.19 it shows 764 for EA's.

 Another twist I just noticed - if I have the client set to not use EA's, I can play the MP3 file from the share by double clicking it, and the WPS plays it. If I have the client set to support EA's, when I double click it, it opens PM123 and plays it. This happens with both the 4.11 and 4.19 servers. Not clear why...

Regards,
« Last Edit: January 21, 2024, 03:28:36 pm by David McKenna »

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2548
  • Karma: +200/-0
    • View Profile
Re: Updated Samba Client
« Reply #125 on: January 21, 2024, 08:25:01 am »
It would be interesting to see the difference in the EA's between the server and the client...

attr.exe -l filename

David McKenna

  • Hero Member
  • *****
  • Posts: 907
  • Karma: +36/-0
    • View Profile
Re: Updated Samba Client
« Reply #126 on: January 21, 2024, 03:21:35 pm »
Paul,

  Attached are:

local.txt - mp3 file on local drive on client
share.txt - same mp3 file after copied to share from client
server.txt - copied mp3 on local drive on server

 All using 4.19 with EA support on both client and server.

Regards,
« Last Edit: January 21, 2024, 03:26:03 pm by David McKenna »

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2548
  • Karma: +200/-0
    • View Profile
Re: Updated Samba Client
« Reply #127 on: January 22, 2024, 09:03:36 am »
Thanks - this was useful - I see another patch that is required to avoid the "user." being pre-pended to existing EA's. https://smedley.id.au/tmp/smbd-4.19.4-20240122.zip  will be available shortly


David McKenna

  • Hero Member
  • *****
  • Posts: 907
  • Karma: +36/-0
    • View Profile
Re: Updated Samba Client
« Reply #128 on: January 22, 2024, 12:19:06 pm »
Thanks Paul - now the EA's shown on the client match those on the server. Still get an 'out of memory' eventually...

 Do you think Theseus might help in identifying what is running out of memory?

Regards,
« Last Edit: January 22, 2024, 01:01:17 pm by David McKenna »

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2548
  • Karma: +200/-0
    • View Profile
Re: Updated Samba Client
« Reply #129 on: January 22, 2024, 09:11:02 pm »
Do you think Theseus might help in identifying what is running out of memory?

I'm not actually convinced that it's an out of  memory condition. There is a Samba error, that is converted to ENOMEM. I just wish I could easily duplicate the error.

What I really need, is a matching set of:
server smbd log with debug level 8
client logs - log.ndpsmb and log.smbc
with notes as to when the error started occuring (date/time)

I tried to reproduce over the weekend but couldn't easily trigger the error :(

David McKenna

  • Hero Member
  • *****
  • Posts: 907
  • Karma: +36/-0
    • View Profile
Re: Updated Samba Client
« Reply #130 on: January 22, 2024, 10:45:12 pm »
Paul,

 OK, I attached 2 zip files - one with server logs and one with client logs with loglevel=8. I started the server and client at 16:28 and got the OOM condition at 16:31. It's  a bummer and surprising you can't easily get it...

Regards,
« Last Edit: January 22, 2024, 11:14:52 pm by David McKenna »

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2548
  • Karma: +200/-0
    • View Profile
Re: Updated Samba Client
« Reply #131 on: January 23, 2024, 03:30:01 am »
Thanks Dave, will review this evening. Much easier to fix if I could easily reproduce :(

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2548
  • Karma: +200/-0
    • View Profile
Re: Updated Samba Client
« Reply #132 on: January 23, 2024, 08:24:02 am »
OK, I attached 2 zip files - one with server logs and one with client logs with loglevel=8. I started the server and client at 16:28 and got the OOM condition at 16:31. It's  a bummer and surprising you can't easily get it...

Unfortunately, I don't think there is enough of the server log there,  due to the log being truncated at 2mb.  The first entry in the server log is already 16:31...

There are some interesting entries like:
Code: [Select]
[2024/01/22 16:31:11.616000,  5] ../../source3/smbd/files.c:1985(file_free)
  file_free: freed files structure 0 (1 used)
[2024/01/22 16:31:11.616000,  5] ../../source3/smbd/files.c:77(fsp_new)
  fsp_new: allocated files structure (2 used)
[2024/01/22 16:31:11.616000,  5] ../../source3/smbd/files.c:179(file_new)
  file_new: new file fnum [invalid value]
[2024/01/22 16:31:11.616000,  5] ../../source3/smbd/files.c:321(openat_internal_dir_from_pathref)
  openat_internal_dir_from_pathref: fd_openat(".", ".") failed: NT_STATUS_NO_MEMORY
[2024/01/22 16:31:11.616000,  5] ../../source3/smbd/files.c:1985(file_free)
  file_free: freed files structure 0 (1 used)
[2024/01/22 16:31:11.616000,  3] ../../source3/smbd/filename.c:319(get_real_filename_full_scan_at)
  get_real_filename_full_scan_at: scan dir didn't open dir [.]: NT_STATUS_NO_MEMORY
[2024/01/22 16:31:11.616000,  5] ../../source3/smbd/files.c:1985(file_free)
  file_free: freed files structure 0 (0 used)
[2024/01/22 16:31:11.616000,  3] ../../source3/smbd/smb2_server.c:4033(smbd_smb2_request_error_ex)
  smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_NO_MEMORY] || at ../../source3/smbd/smb2_create.c:360

So - I'm going to take a look at my fd_openat implementation -  but I'm not sure if this is the original trigger of the issue, or a side effect...

edit: fd_openat is from samba (https://github.com/psmedley/samba-os2/blob/samba-os2-4.19.x/source3/smbd/open.c#L900), but ends up  calling openat() (I think,  via https://github.com/psmedley/samba-os2/blob/samba-os2-4.19.x/source3/modules/vfs_default.c#L653)
« Last Edit: January 23, 2024, 08:28:58 am by Paul Smedley »

David McKenna

  • Hero Member
  • *****
  • Posts: 907
  • Karma: +36/-0
    • View Profile
Re: Updated Samba Client
« Reply #133 on: January 23, 2024, 03:52:36 pm »
 Paul,

 I should have known about the truncation - sorry about that. Did it again with max log set to 500000 - started at 9:35 and got the OOM at 9:38. I can pretty consistently get it in about 3 minutes now. Attached.

Regards,

David McKenna

  • Hero Member
  • *****
  • Posts: 907
  • Karma: +36/-0
    • View Profile
Re: Updated Samba Client
« Reply #134 on: January 23, 2024, 06:51:59 pm »
Paul,

Thanks - this was useful - I see another patch that is required to avoid the "user." being pre-pended to existing EA's. https://smedley.id.au/tmp/smbd-4.19.4-20240122.zip  will be available shortly


 Didn't notice this before (just saw that the EA's were the same on client and server), but USER is still being pre-pended in the EA's. I'll attach examples...

Regards,