Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1571969 > unrolled thread

[PATCH] ubifs: fix data node size for truncating uncompressed nodes

Started byRichard Weinberger <richard@nod.at>
First post2017-02-01 21:50 +0100
Last post2017-02-01 21:50 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] ubifs: fix data node size for truncating uncompressed nodes Richard Weinberger <richard@nod.at> - 2017-02-01 21:50 +0100

#1571969 — [PATCH] ubifs: fix data node size for truncating uncompressed nodes

FromRichard Weinberger <richard@nod.at>
Date2017-02-01 21:50 +0100
Subject[PATCH] ubifs: fix data node size for truncating uncompressed nodes
Message-ID<t6a0O-2qd-7@gated-at.bofh.it>
From: David Oberhollenzer <david.oberhollenzer@sigma-star.at>

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.

Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Signed-off-by: Richard Weinberger <richard@nod.at>
---
 fs/ubifs/journal.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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
 			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;
-- 
2.10.2

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web