]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commit
libext2fs: add ea_inode support to set xattr
authorTahsin Erdogan <tahsin@google.com>
Mon, 24 Jul 2017 02:54:58 +0000 (22:54 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 24 Jul 2017 03:15:08 +0000 (23:15 -0400)
commit50d0998cfee25d09dbddb8a10269a072d89aee14
tree35d312e45b66ea066290683d771546b4633954e2
parent7649f31d4c1d1c7bddb7e7d0235c0b4fa19f1dff
libext2fs: add ea_inode support to set xattr

This patch is a major update to how we decide where to put extended
attributes.  The main motivation is to enable creating values in
extended attribute inodes.  While doing this, we want to implement a
behavior that is as close to kernel as possible.

Existing set ea code deviates from kernel behavior which makes it harder
to implement ea_inode feature:

 - kernel only sorts ea entries in xattr block, e2fsprogs implementation
   sorts all entries on every update.

 - e2fsprogs implementation shuffled things on every update so the order
   of updates does not matter. Kernel does not reshuffle things.

 - e2fsprogs could evacuate entries from inode body to xattr block and
   vice versa. This behavior does not exist in kernel.

Such differences could lead to inconsistent behavior between fuse2fs and
a kernel mount.

With ea_inode feature, we also need to decide whether to put a value
in an inode or keep it 'inline'.  In kernel implementation this
depends on current placement of entries.

To close the behavioral gap, ext2fs_xattr_set() now takes over the
decision about where to place ea values.  This also allows it to raise
errors early instead of delaying them to a separate
ext2fs_xattrs_write() call later.

Signed-off-by: Tahsin Erdogan <tahsin@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
contrib/android/perms.c
debugfs/xattrs.c
e2fsck/pass4.c
lib/ext2fs/ext2fs.h
lib/ext2fs/ext_attr.c
lib/ext2fs/inline_data.c
misc/fuse2fs.c