mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] fs: Fix inode size setting in ftruncate
@ 2020-05-05 12:58 Sascha Hauer
  0 siblings, 0 replies; only message in thread
From: Sascha Hauer @ 2020-05-05 12:58 UTC (permalink / raw)
  To: Barebox List; +Cc: Rouven Czerwinski

When changing a file size the size of the corresponding inode has to be
changed as well.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 fs/fs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/fs.c b/fs/fs.c
index e00bbcd223..77e8f3a1e3 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -223,6 +223,7 @@ int ftruncate(int fd, loff_t length)
 	}
 
 	f->size = length;
+	f->f_inode->i_size = f->size;
 
 	return 0;
 }
-- 
2.26.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-05-05 12:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-05 12:58 [PATCH] fs: Fix inode size setting in ftruncate Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox