aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2018-06-11 18:52:28 -0400
committerRichard Weinberger <richard@nod.at>2018-08-14 18:06:15 -0400
commit59965593205fa4044850d35ee3557cf0b7edcd14 (patch)
tree5ca64a63224a57335a13ce461e35d9a2eabc2a4d
parent00ee8b60102862f4daf0814d12a2ea2744fc0b9b (diff)
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: <stable@vger.kernel.org> Fixes: 1e51764a3c2a ("UBIFS: add new flash file system") Signed-off-by: Richard Weinberger <richard@nod.at>
-rw-r--r--fs/ubifs/journal.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/ubifs/journal.c b/fs/ubifs/journal.c
index 07b4956e0425..c83041891cef 100644
--- a/fs/ubifs/journal.c
+++ b/fs/ubifs/journal.c
@@ -664,6 +664,11 @@ int ubifs_jnl_update(struct ubifs_info *c, const struct inode *dir,
664 spin_lock(&ui->ui_lock); 664 spin_lock(&ui->ui_lock);
665 ui->synced_i_size = ui->ui_size; 665 ui->synced_i_size = ui->ui_size;
666 spin_unlock(&ui->ui_lock); 666 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 }
667 mark_inode_clean(c, ui); 672 mark_inode_clean(c, ui);
668 mark_inode_clean(c, host_ui); 673 mark_inode_clean(c, host_ui);
669 return 0; 674 return 0;