• Eryu Guan's avatar
    ext4: use raw i_version value for ea_inode · e254d1af
    Eryu Guan authored
    Currently, creating large xattr (e.g. 2k) in ea_inode would cause
    ea_inode refcount corruption, e.g.
    
      Pass 4: Checking reference counts
      Extended attribute inode 13 ref count is 0, should be 1. Fix? no
    
    This is because that we save the lower 32bit of refcount in
    inode->i_version and store it in raw_inode->i_disk_version on disk.
    But since commit ee73f9a5 ("ext4: convert to new i_version
    API"), we load/store modified i_disk_version from/to disk instead of
    raw value, which causes on-disk ea_inode refcount corruption.
    
    Fix it by loading/storing raw i_version/i_disk_version, because it's
    a self-managed value in this case.
    
    Fixes: ee73f9a5
    
     ("ext4: convert to new i_version API")
    Cc: Tahsin Erdogan <tahsin@google.com>
    Signed-off-by: default avatarEryu Guan <guaneryu@gmail.com>
    Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
    e254d1af
inode.c 178 KB