Bug 12776 - smbclient NT_STATUS_INVALID_PARAMETER uploading to NetApp filer
Summary: smbclient NT_STATUS_INVALID_PARAMETER uploading to NetApp filer
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Tools (show other bugs)
Version: unspecified
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Jeremy Allison
QA Contact: Samba QA Contact
Depends on:
Reported: 2017-05-06 01:49 UTC by Buck Huppmann
Modified: 2022-01-04 22:05 UTC (History)
5 users (show)

See Also:

my dirty patch (2.65 KB, patch)
2017-05-06 01:49 UTC, Buck Huppmann
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Buck Huppmann 2017-05-06 01:49:33 UTC
Created attachment 13194 [details]
my dirty patch


When our folks started using ubuntu 14.04 at work,
with its samba 4.3.11-based package, smbclient up-
loads to NetApp filers started to fail with
specifically when the file to be uploaded is > 64k

Doing some wireshark-ing, it seems that the newer
smbclient is transmitting a writeAndX with a size
parameter of > 64k, whereas the older clients
(3.6.23-based) that don't upset the NetApp always
limit writes to < 64k

Thiat's with SMB1/NT1, no encryption and no signing,
i believe

I'm guessing this happened when the max write size
nixed, so that smbclient is now seeing the NetApp's
advertised CAP_LARGE_WRITEX and feeling free to
send it writes accordingly large (up to around
0x1ffff bytes, if i'm reading the code right)

Whether or not it's the Right Thing to Do, i patched
libsmb to clamp the write size to 64k when the
server identifies itself as SpinStream2, like our
NetApps (Data ONTAP 8.something) do, and it works,
for smbclient

Attached is the patch against master, as of a couple
days ago, though i haven't tried compiling it, much
less running and testing it

Not that i think this is worthy of applying. It just
demonstrates the problem we have, or at least how we
could fix it, and maybe it'll be of use to anybody
else with the same problem (google produces a few
reports) who's desperate enough to use it
Comment 1 Björn Jacke 2022-01-04 22:05:37 UTC
I think with current samba versions and current ontap this is not a problem anymore, right?