Skip to content

Commit 5996559

Browse files
ubifs: Fix synced_i_size calculation for xattr inodes
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 load. 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: <[email protected]> Fixes: 1e51764 ("UBIFS: add new flash file system") Signed-off-by: Richard Weinberger <[email protected]>
1 parent 00ee8b6 commit 5996559

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

fs/ubifs/journal.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,11 @@ int ubifs_jnl_update(struct ubifs_info *c, const struct inode *dir,
664664
spin_lock(&ui->ui_lock);
665665
ui->synced_i_size = ui->ui_size;
666666
spin_unlock(&ui->ui_lock);
667+
if (xent) {
668+
spin_lock(&host_ui->ui_lock);
669+
host_ui->synced_i_size = host_ui->ui_size;
670+
spin_unlock(&host_ui->ui_lock);
671+
}
667672
mark_inode_clean(c, ui);
668673
mark_inode_clean(c, host_ui);
669674
return 0;

0 commit comments

Comments
 (0)