]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/ubifs/journal.c
ubifs: Fix data node size for truncating uncompressed nodes
[karo-tx-linux.git] / fs / ubifs / journal.c
index 294519b98874058ef7ac7e089361733adb9f26de..f3b620cbdda4c63947c774daab33e980efa42df8 100644 (file)
@@ -1298,7 +1298,9 @@ static int truncate_data_node(const struct ubifs_info *c, const struct inode *in
                        goto out;
        }
 
-       if (compr_type != UBIFS_COMPR_NONE) {
+       if (compr_type == UBIFS_COMPR_NONE) {
+               out_len = *new_len;
+       } else {
                err = ubifs_decompress(c, &dn->data, dlen, buf, &out_len, compr_type);
                if (err)
                        goto out;