Only read potentially matching names into the target buffer, all
obviously non matching names don't need to be read into the
target buffer.
Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
type = le16_to_cpu(entry.type);
prefix = type & SQUASHFS_XATTR_PREFIX_MASK;
- err = squashfs_read_metadata(sb, target, &start, &offset,
- name_size);
+ if (prefix == name_index && name_size == name_len)
+ err = squashfs_read_metadata(sb, target, &start,
+ &offset, name_size);
+ else
+ err = squashfs_read_metadata(sb, NULL, &start,
+ &offset, name_size);
if (err < 0)
goto failed;