u-boot/fs
Anatolij Gustschin 8506eb8d6a FAT: fix some issues in FAT write support code
Writing a file to the FAT partition didn't work while a
test using a CF card. The test was done on mpc5200 based
board (powerpc). There is a number of problems in FAT
write code:

Compiler warning:
fat_write.c: In function 'file_fat_write':
fat_write.c:326: warning: 'counter' may be used uninitialized
in this function
fat_write.c:326: note: 'counter' was declared here

'l_filename' string is not terminated, so a file name
with garbage at the end is used as a file name as shown
by debug code.

Return value of set_contents() is not checked properly
so actually a file won't be written at all (as checked
using 'fatls' after a write attempt with 'fatwrite'
command).

do_fat_write() doesn't return the number of written bytes
if no error happened. However the return value of this
function is used to show the number of written bytes
in do_fat_fswrite().

The patch adds some debug code and fixes above mentioned
problems and also fixes a typo in error output.

NOTE: after a successful write to the FAT partition (under
U-Boot) the partition was checked under Linux using fsck.
The partition needed fixing FATs:
-bash-3.2# fsck -a /dev/sda1
fsck 1.39 (29-May-2006)
dosfsck 2.11, 12 Mar 2005, FAT32, LFN
FATs differ but appear to be intact. Using first FAT.
Performing changes.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Donggeun Kim <dg77.kim@samsung.com>
Cc: Aaron Williams <Aaron.Williams@cavium.com>
Acked-by: Donggeun Kim <dg77.kim@samsung.com>
2011-12-20 23:18:43 +01:00
..
cramfs cramfs: make cramfs usable without a NOR flash 2011-05-10 22:47:32 +02:00
ext2 ext2: Cache line aligned partial sector bounce buffer 2011-10-25 09:25:41 +02:00
fat FAT: fix some issues in FAT write support code 2011-12-20 23:18:43 +01:00
fdos Convert ISO-8859 files to UTF-8 2011-08-04 23:34:02 +02:00
jffs2 fs/jffs2/jffs2_1pass.c: fix warning: variable ... set but not used 2011-10-09 23:24:49 +02:00
reiserfs fs/reiserfs/reiserfs.c: Fix compiler warning 2011-12-12 14:25:30 +01:00
ubifs ubifs bad superblock bug 2011-10-12 11:33:17 +02:00
yaffs2 fs/yaffs2/yaffs_guts.c: Fix GCC 4.6 compile warning (and bug) 2011-12-10 23:08:49 +01:00
Makefile UBIFS: Implement read-only UBIFS support in U-Boot 2009-03-20 22:39:15 +01:00