[Yaffs-archive] Another bug found regarding dev/rdev

Andras Toth Andras.Toth@guardware.com
Thu, 19 Sep 2002 11:20:27 +0200


Hello,

Yet Another YAFFS Bug here :)

The yaffs_mknod function had a parameter 'dev' and a local variable 'dev'.
( shadow problem ). The compiler sent a warning, I could not noticed it among 
the others.
This problem caused the mknod command creating bad device entry with 
major=major=0. 

This is the wrong version:

static int yaffs_mknod(struct inode *dir, struct dentry *dentry, int mode, 
int dev)
...
obj = yaffs_MknodSpecial(parent,dentry->d_name.name,mode,current->uid, 
current->gid,dev);
...

This is the good one:

static int yaffs_mknod(struct inode *dir, struct dentry *dentry, int mode, 
int rdev)
...
obj = yaffs_MknodSpecial(parent,dentry->d_name.name,mode,current->uid, 
current->gid,rdev);
...

The 'only' difference is the dev -> rdev. I fixed it and looks good. I've 
managed to mount the YAFFS as root in a small StrongARM board.
Kernel is loaded 'linearly' from a different NAND partition without YAFFS.

I am very glad now and many-many thanks to the author(s) , saved my job :)
( I had many troubles with jffs2 with this NAND)

Andras


---------------------------------------------------------------------------------------
This mailing list is hosted by Toby Churchill open software (www.toby-churchill.org).
If mailing list membership is no longer wanted you can remove yourself from the list by 
sending an email to yaffs-request@toby-churchill.org with the text "unsubscribe" 
(without the quotes) as the subject.