mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* Problem with long files name in FAT
@ 2011-11-14 20:18 Franck JULLIEN
  2011-11-15 22:46 ` [PATCH] fs/fat: Initialize local variable finfo franck.jullien
  0 siblings, 1 reply; 3+ messages in thread
From: Franck JULLIEN @ 2011-11-14 20:18 UTC (permalink / raw)
  To: barebox

Hi,

Have you ever had any problem with the long files names option of the
FAT filesystem ?

If I use the long files names, the output of ls command is blank.
However, If I undef the
FS_FAT_LFN section of dir_find in ff.c it works....

I don't know how FAT works and I would like to avoid digging into this
piece of code :) So
if anyone has an idea, please help.

Regards,
Franck.

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

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

* [PATCH] fs/fat: Initialize local variable finfo
  2011-11-14 20:18 Problem with long files name in FAT Franck JULLIEN
@ 2011-11-15 22:46 ` franck.jullien
  2011-11-17 16:00   ` Sascha Hauer
  0 siblings, 1 reply; 3+ messages in thread
From: franck.jullien @ 2011-11-15 22:46 UTC (permalink / raw)
  To: barebox

From: Franck Jullien <franck.jullien@gmail.com>

fat_stat in fs/fat.c declares finfo but doesn't initialize it.
When get_fileinfo is called, fno->lfname and fno->lfsize are
tested but haven't been zeroed...This can lead to a wrong
behavior.

Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
---
 fs/fat/fat.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index 4219801..8420f3a 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -354,6 +354,8 @@ static int fat_stat(struct device_d *dev, const char *filename, struct stat *s)
 	FILINFO finfo;
 	int ret;
 
+	memset(&finfo, 0, sizeof(FILINFO));
+
 	ret = f_stat(&priv->fat, filename, &finfo);
 	if (ret)
 		return ret;
-- 
1.7.7


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

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

* Re: [PATCH] fs/fat: Initialize local variable finfo
  2011-11-15 22:46 ` [PATCH] fs/fat: Initialize local variable finfo franck.jullien
@ 2011-11-17 16:00   ` Sascha Hauer
  0 siblings, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2011-11-17 16:00 UTC (permalink / raw)
  To: franck.jullien; +Cc: barebox

On Tue, Nov 15, 2011 at 11:46:28PM +0100, franck.jullien@gmail.com wrote:
> From: Franck Jullien <franck.jullien@gmail.com>
> 
> fat_stat in fs/fat.c declares finfo but doesn't initialize it.
> When get_fileinfo is called, fno->lfname and fno->lfsize are
> tested but haven't been zeroed...This can lead to a wrong
> behavior.

Applied to -master.

Thanks
 Sascha

> 
> Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
> ---
>  fs/fat/fat.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/fat/fat.c b/fs/fat/fat.c
> index 4219801..8420f3a 100644
> --- a/fs/fat/fat.c
> +++ b/fs/fat/fat.c
> @@ -354,6 +354,8 @@ static int fat_stat(struct device_d *dev, const char *filename, struct stat *s)
>  	FILINFO finfo;
>  	int ret;
>  
> +	memset(&finfo, 0, sizeof(FILINFO));
> +
>  	ret = f_stat(&priv->fat, filename, &finfo);
>  	if (ret)
>  		return ret;
> -- 
> 1.7.7
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

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

end of thread, other threads:[~2011-11-17 16:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-14 20:18 Problem with long files name in FAT Franck JULLIEN
2011-11-15 22:46 ` [PATCH] fs/fat: Initialize local variable finfo franck.jullien
2011-11-17 16:00   ` Sascha Hauer

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