9
0
Fork 0
barebox/fs
Sascha Hauer 0b1d85af18 fs: tftp: Fix writing files to tftp
Copying files to tftp is broken since:

| commit d4f5bb1e01
| Author: Sascha Hauer <s.hauer@pengutronix.de>
| Date:   Sat Sep 28 13:12:50 2013 +0200
|
|     copy_file: Add missing O_TRUNC
|
|     Without it, when copying a smaller file over a larger file the
|     resulting file still has the remaining space from the larger file.
|
|     Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

Since this commit copy_file passes O_TRUNC to open(). This results in the
fs layer calling fsdrv->truncate. tftp returns -ENOSYS here and open returns
with an error. To fix this return 0 for the truncate callback in tftp. Also
enforce the O_TRUNC flag when opening a file for writing on tftp as the files
are always truncated on tftp anyway.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reported-by: andreas.willig@rafi.de
2014-02-26 09:36:18 +01:00
..
cramfs fs: cleanup backingstore handling 2013-09-29 12:11:14 +02:00
ext4 fs: cleanup backingstore handling 2013-09-29 12:11:14 +02:00
fat fs: cleanup backingstore handling 2013-09-29 12:11:14 +02:00
ubifs UBIFS: implement readlink entry point 2014-01-30 08:42:53 +01:00
Kconfig Merge branch 'for-next/fs' 2013-10-07 07:59:42 +02:00
Makefile Merge branch 'for-next/fs' 2013-10-07 07:59:42 +02:00
bpkfs.c fs: add BPKFS support 2013-10-06 13:31:55 +02:00
devfs-core.c mtd: Add subpagesize to mtd_info_user 2013-12-20 15:04:30 +01:00
devfs.c Treewide: remove address of the Free Software Foundation 2012-09-17 10:57:41 +02:00
fs.c read_file: Use read_full 2014-02-13 11:18:55 +01:00
nfs.c Treewide: remove address of the Free Software Foundation 2012-09-17 10:57:41 +02:00
omap4_usbbootfs.c omap4: add filesystem support over usb boot 2012-11-16 15:32:31 +01:00
ramfs.c Treewide: remove address of the Free Software Foundation 2012-09-17 10:57:41 +02:00
tftp.c fs: tftp: Fix writing files to tftp 2014-02-26 09:36:18 +01:00
uimagefs.c Merge branch 'for-next/fs' 2013-10-07 07:59:42 +02:00