romfs_mount wrongly returns ENOENT under certain conditions.

Andrew Lunn andrew@lunn.ch
Thu Dec 11 12:55:00 GMT 2003


On Thu, Dec 11, 2003 at 02:23:07PM +0530, sandeep wrote:
> Changelog :
> * src/romfs.c (romfs_mount) : function wrongly returns ENOENT even if
> fste->data isn't NULL.
> 
> Problem :
>   if ( !disk ) {
>       // If still no address, try the FSTAB entry data word
> -- mte->data = fste->data;
> ++ disk = (romfs_disk *)fste->data;
>   }
> 
>   if ( !disk ) {
>       // If still no address, give up...
>       return ENOENT;
>   }
> 
> you will wrongly return ENOENT if disk happened to be NULL at the time of first
> if-check though fste->data isn't NULL. attached patch corrects it.

I've committed this patch,
     Thanks
        Andrew



     

-------------- next part --------------
Index: fs/rom/current//ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/fs/rom/current/ChangeLog,v
retrieving revision 1.12
diff -u -r1.12 ChangeLog
--- fs/rom/current//ChangeLog	4 Oct 2003 19:30:17 -0000	1.12
+++ fs/rom/current//ChangeLog	11 Dec 2003 12:54:29 -0000
@@ -1,3 +1,8 @@
+2003-12-11  Sandeep Kumar <sandeep@codito.com>
+
+	* src/romfs.c (romfs_mount) : function wrongly returns ENOENT even
+	if fste->data isn't NULL.
+
 2003-09-25  Oyvind Harboe <oyvind.harboe@zylin.com>
 
 	* src/romfs.c (romfs_mount): If a mount fails, make sure we leave
Index: fs/rom/current//src/romfs.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/fs/rom/current/src/romfs.c,v
retrieving revision 1.4
diff -u -r1.4 romfs.c
--- fs/rom/current//src/romfs.c	4 Oct 2003 19:30:17 -0000	1.4
+++ fs/rom/current//src/romfs.c	11 Dec 2003 12:54:31 -0000
@@ -603,7 +603,7 @@
 
     if ( !disk ) {
 	// If still no address, try the FSTAB entry data word
-	mte->data = fste->data;
+	disk = (romfs_disk *)fste->data;
     }
 
     if ( !disk ) {


More information about the Ecos-patches mailing list