diff options
author | Richard Weinberger <richard@nod.at> | 2018-06-12 00:52:28 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-09-09 19:56:00 +0200 |
commit | 63bbaa1469e6a037a1f7b84106bf8f0dcb3f6f71 (patch) | |
tree | 0b847a761f53d1e4235f78e7761683080db05c90 | |
parent | 8a23348d76a1e7716da6e76383281ac82fc071cf (diff) | |
download | linux-stable-63bbaa1469e6a037a1f7b84106bf8f0dcb3f6f71.tar.gz linux-stable-63bbaa1469e6a037a1f7b84106bf8f0dcb3f6f71.tar.bz2 linux-stable-63bbaa1469e6a037a1f7b84106bf8f0dcb3f6f71.zip |
ubifs: Fix synced_i_size calculation for xattr inodes
commit 59965593205fa4044850d35ee3557cf0b7edcd14 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
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | fs/ubifs/journal.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/ubifs/journal.c b/fs/ubifs/journal.c index b2419c855b47..69051f7a9606 100644 --- a/fs/ubifs/journal.c +++ b/fs/ubifs/journal.c @@ -665,6 +665,11 @@ int ubifs_jnl_update(struct ubifs_info *c, const struct inode *dir, spin_lock(&ui->ui_lock); ui->synced_i_size = ui->ui_size; spin_unlock(&ui->ui_lock); + if (xent) { + spin_lock(&host_ui->ui_lock); + host_ui->synced_i_size = host_ui->ui_size; + spin_unlock(&host_ui->ui_lock); + } mark_inode_clean(c, ui); mark_inode_clean(c, host_ui); return 0; |