[Samba] (DeviceIoControl, FSCTL_SET_SPARSE)

noid at wolfdogg.org noid at wolfdogg.org
Wed Feb 22 01:20:48 UTC 2017


For some reason It's not erroring now, I will look into it more, but I suspect it’s the settings, the last thing mentioned
David

> [globa]l section is fine, as long as it's not also set in the share section.

So, yeah, that may have fixed im for the time being not getting the sparse errors, for the first time in 4 months, however, there is a couple other problems, so hopefully they wont come back after these disappear.  To be specific the latest issues can be seen by the snippet below on the Freefilesync log.  Im trying to dial in the symlink operation, and any other remaining errors.    

This demonstrates two issues
1)  Cannot write file Error Code 2: The system cannot find the file specified. (BackupWrite)
2)  Error Code 183: Cannot create a file when that file already exists. (CreateSymbolicLinkW)

The symbolic link setting I think I tried both ways, I think I have another toggle on the 3rd party app(ffs) which I need to also have in the correct setting, and to get the combination correct.  Im not sure what the problem is on the BackupWrite.  I had a perminssion error at first, I  `chown`ed the dir, and that went away, I still see the word BackupWrite, which I haven’t seen before, not sure its origin.  


1:00:58 AM	Error	Cannot write file "\\FALCON\pool\appletree\data\public\Downloads\photoshop lightroom plugins\Totally RAD LR Presets\PRE.zip.ffs_tmp".
		Error Code 2: The system cannot find the file specified. (BackupWrite)
1:04:22 AM	Error	Cannot write file "\\FALCON\pool\appletree\data\public\Games\Flight Sims\F4\Falcon_BMS_4.33_U1_Setup.zip.ffs_tmp".
		Error Code 2: The system cannot find the file specified. (BackupWrite)
1:04:22 AM	Error	Cannot copy symbolic link 
		"D:\users\Guest\Application Data" to 
		"\\FALCON\pool\appletree\data\users\Guest\Application Data".
		Error Code 183: Cannot create a file when that file already exists. (CreateSymbolicLinkW)
1:04:22 AM	Error	Cannot copy symbolic link 
		"D:\users\Guest\Cookies" to 
		"\\FALCON\pool\appletree\data\users\Guest\Cookies".
		Error Code 183: Cannot create a file when that file already exists. (CreateSymbolicLinkW)
1:04:22 AM	Error	Cannot copy symbolic link 
		"D:\users\Guest\Local Settings" to 
		"\\FALCON\pool\appletree\data\users\Guest\Local Settings".
		Error Code 183: Cannot create a file when that file already exists. (CreateSymbolicLinkW)
1:04:22 AM	Error	Cannot copy symbolic link 
		"D:\users\Guest\My Documents" to 
		"\\FALCON\pool\appletree\data\users\Guest\My Documents".
		Error Code 183: Cannot create a file when that file already exists. (CreateSymbolicLinkW)
1:04:22 AM	Error	Cannot copy symbolic link 
		"D:\users\Guest\NetHood" to 
		"\\FALCON\pool\appletree\data\users\Guest\NetHood".
		Error Code 183: Cannot create a file when that file already exists. (CreateSymbolicLinkW)
1:04:22 AM	Error	Cannot copy symbolic link 
		"D:\users\Guest\PrintHood" to 
		"\\FALCON\pool\appletree\data\users\Guest\PrintHood".
		Error Code 183: Cannot create a file when that file already exists. (CreateSymbolicLinkW)
1:04:22 AM	Error	Cannot copy symbolic link 
		"D:\users\Guest\Recent" to 
		"\\FALCON\pool\appletree\data\users\Guest\Recent".
		Error Code 183: Cannot create a file when that file already exists. (CreateSymbolicLinkW)
1:04:22 AM	Error	Cannot copy symbolic link 
		"D:\users\Guest\SendTo" to 
		"\\FALCON\pool\appletree\data\users\Guest\SendTo".
		Error Code 183: Cannot create a file when that file already exists. (CreateSymbolicLinkW)
1:04:22 AM	Error	Cannot copy symbolic link 
		"D:\users\Guest\Start Menu" to 
		"\\FALCON\pool\appletree\data\users\Guest\Start Menu".
		Error Code 183: Cannot create a file when that file already exists. (CreateSymbolicLinkW)
1:04:22 AM	Error	Cannot copy symbolic link 
		"D:\users\Guest\Templates" to 
		"\\FALCON\pool\appletree\data\users\Guest\Templates".
		Error Code 183: Cannot create a file when that file already exists. (CreateSymbolicLinkW)
1:04:22 AM	Error	Cannot copy symbolic link 
		"D:\users\Guest\AppData\Local\Application Data" to 
		"\\FALCON\pool\appletree\data\users\Guest\AppData\Local\Application Data".
		Error Code 183: Cannot create a file when that file already exists. (CreateSymbolicLinkW)
1:04:22 AM	Error	Cannot copy symbolic link 
		"D:\users\Guest\AppData\Local\History" to 
		"\\FALCON\pool\appletree\data\users\Guest\AppData\Local\History".
		Error Code 183: Cannot create a file when that file already exists. (CreateSymbolicLinkW)) 


1:00:58 AM	Error	Cannot write file "\\FALCON\pool\appletree\data\public\Downloads\photoshop lightroom plugins\SLR Lounge - Lightroom Preset System v5.1 - PC [lessgravity]\LR Preset System v5.1 Windows Installer.exe.ffs_tmp".
		Error Code 2: The system cannot find the file specified. (BackupWrite)
1:00:58 AM	Error	Cannot write file "\\FALCON\pool\appletree\data\public\Downloads\photoshop lightroom plugins\Totally RAD LR Presets\PRE.zip.ffs_tmp".
		Error Code 2: The system cannot find the file specified. (BackupWrite)
1:04:22 AM	Error	Cannot write file "\\FALCON\pool\appletree\data\public\Games\Flight Sims\F4\Falcon_BMS_4.33_U1_Setup.zip.ffs_tmp".
		Error Code 2: The system cannot find the file specified. (BackupWrite)
1:04:22 AM	Error	Cannot copy symbolic link 
		"D:\users\Guest\Application Data" to 
		"\\FALCON\pool\appletree\data\users\Guest\Application Data".
		Error Code 183: Cannot create a file when that file already exists. (CreateSymbolicLinkW)
1:04:22 AM	Error	Cannot copy symbolic link 
		"D:\users\Guest\Cookies" to 
		"\\FALCON\pool\appletree\data\users\Guest\Cookies".
		Error Code 183: Cannot create a file when that file already exists. (CreateSymbolicLinkW)
1:04:22 AM	Error	Cannot copy symbolic link 
		"D:\users\Guest\Local Settings" to 
		"\\FALCON\pool\appletree\data\users\Guest\Local Settings".
		Error Code 183: Cannot create a file when that file already exists. (CreateSymbolicLinkW)
1:04:22 AM	Error	Cannot copy symbolic link 
		"D:\users\Guest\My Documents" to 
		"\\FALCON\pool\appletree\data\users\Guest\My Documents".
		Error Code 183: Cannot create a file when that file already exists. (CreateSymbolicLinkW)
1:04:22 AM	Error	Cannot copy symbolic link 
		"D:\users\Guest\NetHood" to 
		"\\FALCON\pool\appletree\data\users\Guest\NetHood".
		Error Code 183: Cannot create a file when that file already exists. (CreateSymbolicLinkW)
1:04:22 AM	Error	Cannot copy symbolic link 
		"D:\users\Guest\PrintHood" to 
		"\\FALCON\pool\appletree\data\users\Guest\PrintHood".
		Error Code 183: Cannot create a file when that file already exists. (CreateSymbolicLinkW)
1:04:22 AM	Error	Cannot copy symbolic link 
		"D:\users\Guest\Recent" to 
		"\\FALCON\pool\appletree\data\users\Guest\Recent".
		Error Code 183: Cannot create a file when that file already exists. (CreateSymbolicLinkW)
1:04:22 AM	Error	Cannot copy symbolic link 
		"D:\users\Guest\SendTo" to 
		"\\FALCON\pool\appletree\data\users\Guest\SendTo".
		Error Code 183: Cannot create a file when that file already exists. (CreateSymbolicLinkW)
1:04:22 AM	Error	Cannot copy symbolic link 
		"D:\users\Guest\Start Menu" to 
		"\\FALCON\pool\appletree\data\users\Guest\Start Menu".
		Error Code 183: Cannot create a file when that file already exists. (CreateSymbolicLinkW)
1:04:22 AM	Error	Cannot copy symbolic link 
		"D:\users\Guest\Templates" to 
		"\\FALCON\pool\appletree\data\users\Guest\Templates".
		Error Code 183: Cannot create a file when that file already exists. (CreateSymbolicLinkW)
1:04:22 AM	Error	Cannot copy symbolic link 
		"D:\users\Guest\AppData\Local\Application Data" to 
		"\\FALCON\pool\appletree\data\users\Guest\AppData\Local\Application Data".
		Error Code 183: Cannot create a file when that file already exists. (CreateSymbolicLinkW)
1:04:22 AM	Error	Cannot copy symbolic link 
		"D:\users\Guest\AppData\Local\History" to 
		"\\FALCON\pool\appletree\data\users\Guest\AppData\Local\History".
		Error Code 183: Cannot create a file when that file already exists. (CreateSymbolicLinkW)

So, if anybody sees anything related, let me know, 
and THANKS MUCH otherwise, for all the support,  I hadn’t seen the dos attributes option until I had already posted my first message, but still, its not always apparent if I should actually put this setting in global, I think I might try it just in the definition for the zfs share next though, that would be ideal.  The problem is, I think it took a full reboot, or maybe even zfs export and import, or something to actually trigger in these new settings, something changed at an unexpected time, that’s all I know, the reason I say this is because things just didn’t start working after a samba config update and a `systemctl restart smb && systemctl restart nmb`, it was hours or days later on another test which I noticed it started working.  


Regards,
Brian






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

Hi Brian,

On Thu, 16 Feb 2017 01:20:46 -0800, brian lamb via samba wrote:

> Configured as you mention, and prior with the other tweaks I had in the first place,  Im getting the same results, which is "FSUTIL utility requires a Local NTFS Volume", and mapping it.

Hmm, this works fine for me against a Samba 4.4.2 Btrfs backed Samba share.

smb.conf:
[global]
	...
        store dos attributes = yes

[share]
        path = /tmp/tmp.UR3ZbULpHJ
        read only = no

Windows Server 2012 client:
("store dos attributes = no" configured on server)
PS> fsutil.exe sparse setflag \\samba_server\share\file
Error:  Incorrect function.

("store dos attributes = yes" configured on server)
PS> fsutil.exe sparse setflag \\samba_server\share\file fsutil.exe 
PS> sparse queryflag \\samba_server\share\file
This file is set as sparse

I don't think it's worth trying to triage your application problems any further until you have this simple test case working. Please set "log level = 10" on the Samba server, and rerun the above test.
Attach the resulting debug log to a bugzilla.samba.org ticket.

Also, please check whether you can manually set an extended attribute locally against a file in your share path. e.g.
samba_server:/tmp/tmp.UR3ZbULpHJ/:[0]# setfattr -n user.stuff -v xattr-data file samba_server:/tmp/tmp.UR3ZbULpHJ/:[0]# getfattr -d file user.stuff="xattr-data"

Furthermore, could you please check whether Samba is compiled with xattr support - i.e.:
samba_server:# smbd -b | grep -i xattr

> I then went to contig, `contig -n X:\share\sparesefile 0`, as well as a few other size.  Maybe im using it wrong, but some testing on contig has only "Access is denied" when I try to write to anything. 
> 
> Oh one change, I put these settings only in Global (only, as opposed to also in the pool definition), I just realized.  I believe global should be enough shouldn’t it? 

[globa]l section is fine, as long as it's not also set in the share section.

> [global]
>     # ZFS SPARSE
>     #share:fake_fscaps = 0
>     store dos attributes = yes
>     strict allocate = yes
> 
> I hadn’t heard any mention of the importance of strict allocate, would that setting be wise then?

It doesn't affect how FSCTL_SET_SPARE is handled.

> What are some other tools I might try that with?  I can try straight on the linux too, just as a test, if there is any tools recommended to test that with.  I will also look something up for that tomorrow as well.  

Let's get "fsutil.exe sparse setflag" working first.

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