[Samba] Large file stream extended attribute support

Linda Walsh samba at tlinx.org
Thu Aug 11 00:21:41 MDT 2011


T L wrote:
> Hi list,
> 
> Does Samba support large extended attributes? By this I'm referring to
> attributes that are alternate streams attached to a file.
> 
> http://msdn.microsoft.com/en-us/library/aa364404%28v=vs.85%29.aspx
> 
> Seeing a problem when the referenced stream points to large files (sometimes
> 3M+).
> 
> Thanks for the help,
> - T
---
	I'm guessing it depends on what file system you are using and how big 
the extended attributes are that it supports.  XFS, I think is limited 
to something like 64k/attr (but don't quote me on that!) of extended 
attributes; I've no idea if there is a combined limit.



Maybe another file system supports larger.

There's also a samba option to store extended attributes in a file 
'somewhere' ...
it's a vfs module...

IT says 'experimental''...but the vfs_streams_depot, might work

There are also modules 'vss_streams_xattr, to store them in extended 
attributes,
and there's a vfs_xattr_tdb, which can store EA's in a TDB,

I don't know if the modules 'stack'...but if the vfs_streams_depot doesn't
work, then if you used the vfs_xattr_tdb, and stored all your attr's in 
a TDB (a database
file), then the vfs_streams_xattr to store streams in xattrs ***might*** 
store
the streams in the tdb...

But 3M for an alternate data stream is pretty 'huge'....compared to 
normal purposes -- generally to hold things like the file's source 
(internet or not, so it can give you a message about it possibly being 
'unsafe' to open)....little bits and pieces.


It's not 'normally', AFAIK, used for general purpose data storage...i.e. 
3M of data should
probably be stored in a normal file, not a 'resource-fork/data stream, 
as those are more for
metadata.

Here's what the manpage for xfs-attr says about 'extended attrs':


  Extended  attributes  implement  the  ability  for  a  user  to  attach
        name:value pairs to objects within the XFS filesystem.

        This document describes the attr command, which  is  mostly 
compatible
        with  the IRIX command of the same name.  It is thus aimed 
specifically
        at users of the XFS filesystem - for  filesystem  independent 
extended
        attribute  manipulation,  consult the getfattr(1) and 
setfattr(1) docu‐
        mentation.

        Extended attributes can be used to  store  meta-information 
about  the
        file.   For example "character-set=kanji" could tell a document 
browser
        to use the Kanji  character  set  when  displaying  that 
document  and
        "thumbnail=..."  could  provide a reduced resolution overview of 
a high
        resolution graphic image.

        In the XFS filesystem, the names can be up to 256 bytes in 
length, ter‐
        minated  by  the  first  0  byte.  The intent is that they be 
printable
        ASCII (or other character set) names for the attribute.  The 
values can
        be up to 64KB of arbitrary binary data.



(of course you 'could' have 3M of metadata, but it would be unusual...)

Do you really have 3M of name=attribute strings?



Good luck!...



More information about the samba mailing list