Andrea Cucciarre'
2019-Mar-05 12:14 UTC
[Samba] Enable XAT_OFFLINE extended attribute in Samba
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 Il 3/4/2019 8:06 PM, Jeremy Allison via samba ha scritto:> On Mon, Mar 04, 2019 at 06:39:21PM +0000, Rowland Penny wrote: >> On Mon, 4 Mar 2019 10:25:59 -0800 >> Jeremy Allison via samba <samba at lists.samba.org> wrote: >> >>> On Mon, Mar 04, 2019 at 04:48:56PM +0100, Andrea Cucciarre' via samba >>> wrote: >>>> Hello, >>>> >>>> Does Samba support XAT_OFFLINE and XAT_ONLINE extended attribute? >>>> I have enabled "ea support = yes" but it seems to have no effect on >>>> that. >>> Googling for XAT_OFFLINE or XAT_ONLINE doesn't return anything. >> Yeh, my Googlefu is better than somebody who works for Google ;-) > Oh the shame, the shame :-). Having said that I am at > a conference and really should be paying attention to the > lectures :-). > >> It seems to be something to do with ZFS on illumos: >> >> https://github.com/openzfs/openzfs/blob/master/usr/src/uts/common/fs/xattr.c > Thnaks Rowland, I'll take a look ! >
Jeremy Allison
2019-Mar-05 19:28 UTC
[Samba] Enable XAT_OFFLINE extended attribute in Samba
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 ClientGot 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.
Andrea Cucciarre'
2019-Mar-07 08:11 UTC
[Samba] Enable XAT_OFFLINE extended attribute in Samba
Thanks for the suggestion Jeremy, we are going to build our own module Andrea Il 3/5/2019 8:28 PM, Jeremy Allison ha scritto:> 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.
David Disseldorp
2019-Mar-07 12:18 UTC
[Samba] Enable XAT_OFFLINE extended attribute in Samba
On Tue, 5 Mar 2019 11:28:25 -0800, Jeremy Allison via samba wrote:> 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.IIUC, DMAPI will never make it into mainline. It'd be good if we could settle on a standard xattr or statx flag for offline files on Linux / BSD, which could then be used by FSes offering some form of HSM. Extending user.DOSATTRIB might be an option, but wouldn't be too friendly to other potential external consumers. Cheers, David