summaryrefslogtreecommitdiffstats
path: root/fs/ubifs/journal.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2017-05-17 04:36:45 -0400
committerRichard Weinberger <richard@nod.at>2017-07-14 16:49:06 -0400
commit59a74990f85bb372c9117e40c6cd27693b6df670 (patch)
treedc30367f55104dfd9ac7989dda1ec8cbeae630e8 /fs/ubifs/journal.c
parentf34e87f58dabc31eb69f61cf4a79e951d4176743 (diff)
ubifs: Fix data node size for truncating uncompressed nodes
Currently, the function truncate_data_node only updates the destination data node size if compression is used. For uncompressed nodes, the old length is incorrectly retained. This patch makes sure that the length is correctly set when compression is disabled. Fixes: 7799953b34d1 ("ubifs: Implement encrypt/decrypt for all IO") Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'fs/ubifs/journal.c')
-rw-r--r--fs/ubifs/journal.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/ubifs/journal.c b/fs/ubifs/journal.c
index 294519b98874..f3b620cbdda4 100644
--- a/fs/ubifs/journal.c
+++ b/fs/ubifs/journal.c
@@ -1298,7 +1298,9 @@ static int truncate_data_node(const struct ubifs_info *c, const struct inode *in
1298 goto out; 1298 goto out;
1299 } 1299 }
1300 1300
1301 if (compr_type != UBIFS_COMPR_NONE) { 1301 if (compr_type == UBIFS_COMPR_NONE) {
1302 out_len = *new_len;
1303 } else {
1302 err = ubifs_decompress(c, &dn->data, dlen, buf, &out_len, compr_type); 1304 err = ubifs_decompress(c, &dn->data, dlen, buf, &out_len, compr_type);
1303 if (err) 1305 if (err)
1304 goto out; 1306 goto out;