summaryrefslogtreecommitdiffstats
path: root/fs/ubifs
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2016-09-20 10:08:30 +0200
committerRichard Weinberger <richard@nod.at>2016-10-20 00:05:54 +0200
commit843741c5778398ea67055067f4cc65ae6c80ca0e (patch)
treed03c20663d763214350f6e40e418513c2dc17a6c /fs/ubifs
parent390975ac3978162ec9c6beca66f0fe83b0be33bb (diff)
downloadlinux-843741c5778398ea67055067f4cc65ae6c80ca0e.tar.gz
linux-843741c5778398ea67055067f4cc65ae6c80ca0e.tar.bz2
linux-843741c5778398ea67055067f4cc65ae6c80ca0e.zip
ubifs: Fix xattr_names length in exit paths
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>
Diffstat (limited to 'fs/ubifs')
-rw-r--r--fs/ubifs/xattr.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/ubifs/xattr.c b/fs/ubifs/xattr.c
index 6c2f4d41ed73..d9f9615bfd71 100644
--- a/fs/ubifs/xattr.c
+++ b/fs/ubifs/xattr.c
@@ -172,6 +172,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);
@@ -478,6 +479,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);