linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] ubifs: Fix data node size for truncating uncompressed nodes
@ 2017-02-09 21:28 Richard Weinberger
  2017-02-09 21:28 ` [PATCH 2/4] ubifs: Fix unlink code wrt. double hash lookups Richard Weinberger
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Richard Weinberger @ 2017-02-09 21:28 UTC (permalink / raw)
  To: linux-mtd
  Cc: linux-kernel, dedekind1, david.oberhollenzer, Richard Weinberger

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

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-07-16 12:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-09 21:28 [PATCH 1/4] ubifs: Fix data node size for truncating uncompressed nodes Richard Weinberger
2017-02-09 21:28 ` [PATCH 2/4] ubifs: Fix unlink code wrt. double hash lookups Richard Weinberger
2017-03-09  7:04   ` Hyunchul Lee
2017-03-19 20:46     ` Richard Weinberger
2017-07-16 12:12       ` Geert Uytterhoeven
2017-07-16 12:17         ` Richard Weinberger
2017-07-16 12:19           ` Richard Weinberger
2017-02-09 21:28 ` [PATCH 3/4] ubifs: Add assert to dent_key_init() Richard Weinberger
2017-02-09 21:28 ` [PATCH 4/4] ubifs: Massage debug prints wrt. fscrypt Richard Weinberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).