summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2016-09-20 10:08:30 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-10-28 03:45:30 -0400
commite435e0e30773b2817921edad74de9f8e8568d567 (patch)
tree5d0a68847814fa24877b485142fd30544b4088fa /fs
parent58f620cf12494820c7f206abadb0096abc72e2e0 (diff)
ubifs: Fix xattr_names length in exit paths
commit 843741c5778398ea67055067f4cc65ae6c80ca0e upstream. When the operation fails we also have to undo the changes we made to ->xattr_names. Otherwise listxattr() will report wrong lengths. Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-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 11a004114eba..c9ee6f6efa07 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);
@@ -476,6 +477,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);