diff options
| author | Richard Weinberger <richard@nod.at> | 2016-09-20 10:08:30 +0200 |
|---|---|---|
| committer | Ben Hutchings <ben@decadent.org.uk> | 2017-02-23 03:50:54 +0000 |
| commit | 72ee01777f49f472f0355ba8dfc32b1570a68df2 (patch) | |
| tree | 77e498c4dc3a485903b42a2056f658477ef6e4b2 /fs | |
| parent | 7783166798fa713a278e81afa2712d24bbfbfd13 (diff) | |
| download | linux-72ee01777f49f472f0355ba8dfc32b1570a68df2.tar.gz linux-72ee01777f49f472f0355ba8dfc32b1570a68df2.tar.bz2 linux-72ee01777f49f472f0355ba8dfc32b1570a68df2.zip | |
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: Ben Hutchings <ben@decadent.org.uk>
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 bf18f7a04544..28b7ebf5d0d9 100644 --- a/fs/ubifs/xattr.c +++ b/fs/ubifs/xattr.c @@ -168,6 +168,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); @@ -516,6 +517,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); |
