diff options
author | Richard Weinberger <richard@nod.at> | 2016-09-20 10:08:30 +0200 |
---|---|---|
committer | Sasha Levin <alexander.levin@verizon.com> | 2016-11-23 19:58:29 -0500 |
commit | cad1ca2a9485333c04581c69bbbe52fbd410d9ec (patch) | |
tree | cee7d04bdd0eb5e360f75d877868840329b853ea /fs | |
parent | dfeb7e4f30e9179098fd8344f29478c6f3d1bb14 (diff) |
ubifs: Fix xattr_names length in exit paths
[ Upstream commit 843741c5778398ea67055067f4cc65ae6c80ca0e ]
When the operation fails we also have to undo the changes
we made to ->xattr_names. Otherwise listxattr() will report
wrong lengths.
Cc: stable@vger.kernel.org
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ubifs/xattr.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/ubifs/xattr.c b/fs/ubifs/xattr.c index fd65b3f1923c..7270162b72e4 100644 --- a/fs/ubifs/xattr.c +++ b/fs/ubifs/xattr.c @@ -173,6 +173,7 @@ out_cancel: host_ui->xattr_cnt -= 1; host_ui->xattr_size -= CALC_DENT_SIZE(nm->len); host_ui->xattr_size -= CALC_XATTR_BYTES(size); + host_ui->xattr_names -= nm->len; mutex_unlock(&host_ui->ui_mutex); out_free: make_bad_inode(inode); @@ -527,6 +528,7 @@ out_cancel: host_ui->xattr_cnt += 1; host_ui->xattr_size += CALC_DENT_SIZE(nm->len); host_ui->xattr_size += CALC_XATTR_BYTES(ui->data_len); + host_ui->xattr_names += nm->len; mutex_unlock(&host_ui->ui_mutex); ubifs_release_budget(c, &req); make_bad_inode(inode); |