[Samba] (DeviceIoControl, FSCTL_SET_SPARSE)

noid at wolfdogg.org noid at wolfdogg.org
Wed Feb 15 07:16:22 UTC 2017

To whomever reads this, 
This post I accidentally sent to david himself, I am now sending it to the group.  It will be out of order, and includes the strace.


My apologies for any inconvenience. 


Hi David,

Thanks for your response. 

The Error message is for e.g.:

Cannot write file attributes of "\\MYHOST\backup\sparse\My Family Tree 6.0.zip.ffs_tmp".
Error Code 1: Incorrect function. (DeviceIoControl, FSCTL_SET_SPARSE)

Samba Version:
Samba version 4.4.4
PID     Username     Group        Machine                                   Protocol Version  Encryption           Signing
21582   backupadmin sys1       myhost (ipv4:         SMB2_10           -                    -

I just tried the option   " store dos attributes = no"
Im getting the same error as above still unfortunately, but im doing some more thorough testing on that.  WOud you happen to know if I want the other two options set, and to what, at all? (> strict allocate & share:fake_fscaps = 0)

The application (freefilesync) has worked successfully against Samba before I rebuilt the array to a raidz2, from a zfs linear span (no raid parity disk, still other features worked, scrub, crc checking, etc..) and I had no problem in the 6TB 3 disk span.  Now I added three disks, , its now ~8TB with two parity disks.    The only thing I can imagine different is the freefilesync program, since there was a gap in time when I switched out the raid array, it didn’t work from the get go(the sparse part, same errors) but this was about a month or two, and a new version of freefilesync I believe too.  I noted tht  freefilesync has supported sparse for a long time, and I posted the url for the freefilesync forum, where the author of the app himself suspected it was possibly samba, see that post.

Much Appreciated David!

Regards Brian

-----Original Message-----
From: samba [mailto:samba-bounces at lists.samba.org] On Behalf Of David Disseldorp via samba
Sent: Tuesday, February 14, 2017 2:55 AM
To: brian lamb via samba <samba at lists.samba.org>
Subject: Re: [Samba] (DeviceIoControl, FSCTL_SET_SPARSE)

Hi Brian,

On Mon, 13 Feb 2017 19:16:13 -0800, brian lamb via samba wrote:

> Im having an issue with what I believe might be pinned down to a need 
> for a proper samba configuration.

Which version of Samba are you using?

> The problem: sparse writes (not sure which, either write sparse files 
> to a system that doesn't support them, or vice versa)

What doesn't support sparse writes? How do you know that the problem is related to sparse files?

> The system:
> Zfs-on-linux, samba share

ZFS on Linux + Samba supports sparse files...

> Accessing system which is erroring:
> Win7x64_ult, freefilesync
> Error message

What's the error message? Has this application ever worked successfully against Samba, or only against a Windows share?

> NOTHING I have done to it is fixing, including
> strict allocate = yes
> strict allocate = no
> share:fake_fscaps = 0
> #share:fake_fscaps = 0

Windows clients request sparse file semantics explicitly, by calling FSCTL_SET_SPARSE. Samba then retains this flag in the "user.DOSATTRIB"
extended attribute for the given file.
One way to modify this behaviour would be to set "store dos attributes"
to "no" in smb.conf - this would see Samba respond to any FSCTL_SET_SPARSE request with NT_STATUS_INVALID_DEVICE_REQUEST. That said, I have no idea whether or not this will fix the application error that you're seeing.

Cheers, David

To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba

More information about the samba mailing list