[Samba] Enable XAT_OFFLINE extended attribute in Samba

Jeremy Allison jra at samba.org
Tue Mar 5 19:28:25 UTC 2019


On Tue, Mar 05, 2019 at 01:14:00PM +0100, Andrea Cucciarre' wrote:
> My goal is to use the Offline file attribute of Windows when sharing with
> Samba:
> 
> https://docs.microsoft.com/en-us/dotnet/api/system.io.fileattributes?redirectedfrom=MSDN&view=netframework-4.7.2
> 
> It works when I share ZFS filesystem using the native ZFS CIFS sharing, but
> it fails when I share the same ZFS with Samba, that is the Offline files are
> not showed in Windows Client

Got it. Currently, Samba uses the dmapi API to
check if a file has been migrated to external
storage, and to cope with reads/writes against
it.

Look at the VFS module source3/modules/vfs_tsmsm.c
which, as decribed, is:

  Samba VFS module for handling offline files
  with Tivoli Storage Manager Space Management

You would need to create a similar VFS module
on ZFS to expose the FILE_ATTRIBUTE_OFFLINE
flag to the client. Mostly it'll be wrapping
the [f]get_dos_attributes() VFS calls.

A bit fiddly, but doable (especially by companies
used to Samba coding internals).

Jeremy.



More information about the samba mailing list