From: Eric Sandeen Date: Thu, 25 Apr 2013 04:14:33 +0000 (-0400) Subject: e2fsprogs: allow 0-length xattr values in e2fsck X-Git-Tag: v1.42.8~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=10fc3a63d9b7efb14e810ee94ad1d2f254d44eae;p=thirdparty%2Fe2fsprogs.git e2fsprogs: allow 0-length xattr values in e2fsck e2fsck thinks that this: # touch mnt/testfile1 # setfattr -n "user.test" mnt/testfile1 results in a filesystem with corruption: Pass 1: Checking inodes, blocks, and sizes Extended attribute in inode 12 has a value size (0) which is invalid Clear? yes but as far as I can tell, there is absolutely nothing wrong with a 0-length value on an extended attribute. Just remove the check. Reported-by: David Shaw Reported-by: Harald Reindl Addresses-Red-Hat-Bugzilla: #557959 Signed-off-by: Eric Sandeen Signed-off-by: Theodore Ts'o --- diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c index 9c375154c..409570308 100644 --- a/e2fsck/pass1.c +++ b/e2fsck/pass1.c @@ -307,7 +307,7 @@ static void check_ea_in_inode(e2fsck_t ctx, struct problem_context *pctx) remain -= EXT2_EXT_ATTR_SIZE(entry->e_name_len); /* check value size */ - if (entry->e_value_size == 0 || entry->e_value_size > remain) { + if (entry->e_value_size > remain) { pctx->num = entry->e_value_size; problem = PR_1_ATTR_VALUE_SIZE; goto fix;