Commit 63bbaa14 authored by Richard Weinberger's avatar Richard Weinberger Committed by Greg Kroah-Hartman

ubifs: Fix synced_i_size calculation for xattr inodes

commit 59965593 upstream.

In ubifs_jnl_update() we sync parent and child inodes to the flash,
in case of xattrs, the parent inode (AKA host inode) has a non-zero
data_len. Therefore we need to adjust synced_i_size too.

This issue was reported by ubifs self tests unter a xattr related work
UBIFS error (ubi0:0 pid 1896): dbg_check_synced_i_size: ui_size is 4, synced_i_size is 0, but inode is clean
UBIFS error (ubi0:0 pid 1896): dbg_check_synced_i_size: i_ino 65, i_mode 0x81a4, i_size 4

Cc: <>
Fixes: 1e51764a ("UBIFS: add new flash file system")
Signed-off-by: Richard Weinberger's avatarRichard Weinberger <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent 8a23348d
......@@ -665,6 +665,11 @@ int ubifs_jnl_update(struct ubifs_info *c, const struct inode *dir,
ui->synced_i_size = ui->ui_size;
if (xent) {
host_ui->synced_i_size = host_ui->ui_size;
mark_inode_clean(c, ui);
mark_inode_clean(c, host_ui);
return 0;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment