Re: What's a realistic size for xattr?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2008-03-13 at 11:06 +1300, Charles Manning wrote:
> I'm trying to figure out a reasonable approach to implementing xattr in YAFFS.
> 
> >From my (limited) knowledge of xattr it seems that in theory you could store a 
> multi-Mbyte database in xattr, but in practice a smaller size is far more 
> reasonable. Clearly storing/managing a small blob is going to be a lot 
> simpler.
> 
> What is the cut off of a reasonable xattr blob size? 1kbytes? 2kbytes?...
> 
> Thanx.
> 
> Charles
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

I don't know about specific file system limits on xattrs but from a
user-space perspective the sys_setxattr->setxattr call chain enforces a
limit of no more than 64k on an xattr value. In addition the list of
xattr names is also limited to 64k with a name being no longer than 255
chars. From your wording above it seems that you want to store the
xattrs as their own records. One approach (which is different from what
I think you want) is to store the xattrs in the inode upto a point and
then if necessary allocate space from them elsewhere. I'm not familiar
with what you are trying to implement but I believe this is the way XFS
handles xattrs.

#define XATTR_NAME_MAX   255    /* # chars in an extended attribute name */
#define XATTR_SIZE_MAX 65536    /* size of an extended attribute value (64k) */
#define XATTR_LIST_MAX 65536    /* size of extended attribute namelist (64k) */

Dave

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux