summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-12-12 20:57:22 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-12 20:57:22 +0300
commitccb5a4910d0ca7b1742b9217db2e1b95817e25ac (patch)
tree721ea6e0e06376366f7cfcb358eb61b8a9dc9c65 /fs
parentc05e14f7b3145ac89635fa398934438240dace40 (diff)
parentf38aed975c0c3645bbdfc5ebe35726e64caaf588 (diff)
downloadlinux-ccb5a4910d0ca7b1742b9217db2e1b95817e25ac.tar.xz
Merge tag 'upstream-3.19-rc1' of git://git.infradead.org/linux-ubifs
Pull UBI/UBIFS updates from Artem Bityutskiy: "This includes the following UBI/UBIFS changes: - UBI debug messages now include the UBI device number. This change is responsible for the big diffstat since it touched every debugging print statement. - An Xattr bug-fix which fixes SELinux support - Several error path fixes in UBI/UBIFS" * tag 'upstream-3.19-rc1' of git://git.infradead.org/linux-ubifs: UBI: Fix invalid vfree() UBI: Fix double free after do_sync_erase() UBIFS: fix a couple bugs in UBIFS xattr length calculation UBI: vtbl: Use ubi_eba_atomic_leb_change() UBI: Extend UBI layer debug/messaging capabilities UBIFS: fix budget leak in error path
Diffstat (limited to 'fs')
-rw-r--r--fs/ubifs/file.c1
-rw-r--r--fs/ubifs/journal.c7
2 files changed, 7 insertions, 1 deletions
diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c
index b5b593c45270..538519ee37d9 100644
--- a/fs/ubifs/file.c
+++ b/fs/ubifs/file.c
@@ -262,6 +262,7 @@ static int write_begin_slow(struct address_space *mapping,
if (err) {
unlock_page(page);
page_cache_release(page);
+ ubifs_release_budget(c, &req);
return err;
}
}
diff --git a/fs/ubifs/journal.c b/fs/ubifs/journal.c
index fb166e204441..f6ac3f29323c 100644
--- a/fs/ubifs/journal.c
+++ b/fs/ubifs/journal.c
@@ -571,7 +571,11 @@ int ubifs_jnl_update(struct ubifs_info *c, const struct inode *dir,
aligned_dlen = ALIGN(dlen, 8);
aligned_ilen = ALIGN(ilen, 8);
+
len = aligned_dlen + aligned_ilen + UBIFS_INO_NODE_SZ;
+ /* Make sure to also account for extended attributes */
+ len += host_ui->data_len;
+
dent = kmalloc(len, GFP_NOFS);
if (!dent)
return -ENOMEM;
@@ -648,7 +652,8 @@ int ubifs_jnl_update(struct ubifs_info *c, const struct inode *dir,
ino_key_init(c, &ino_key, dir->i_ino);
ino_offs += aligned_ilen;
- err = ubifs_tnc_add(c, &ino_key, lnum, ino_offs, UBIFS_INO_NODE_SZ);
+ err = ubifs_tnc_add(c, &ino_key, lnum, ino_offs,
+ UBIFS_INO_NODE_SZ + host_ui->data_len);
if (err)
goto out_ro;