Re: [Yaffs] YAFFS2 mounting : not inherits ownerships/permis…

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Ian McDonnell
Date:  
To: Wookey
CC: yaffs
Subject: Re: [Yaffs] YAFFS2 mounting : not inherits ownerships/permissions ?
On Monday 24 September 2007 11:55, Wookey wrote:
> On 2007-09-24 10:14 -0400, Ian McDonnell wrote:
> > On Monday 24 September 2007 09:01, Renaud Cerrato wrote:
> > > Using Linux 2.6.21 on AT91RM9260 ARM machine with YAFFS2
> > > support: when mounting, permissions & ownerships are not
> > > transfered ?
> >
> > Transferred from where?
> >
> > > # ls -la /etc | grep config
> > > drwxr-xr-x    1 root     other        2048 Sep 24 11:59
> > > config # mount -t yaffs2 /dev/mtdblock3 /etc/config
> > > yaffs: dev is 32505859 name is "mtdblock3"
> > > yaffs: passed flags ""
> > > yaffs: Attempting MTD mount on 31.3, "mtdblock3"
> > > yaffs: restored from checkpoint
> > > # ls -la /etc | grep config
> > > drw-rw-rw-    1 root     root         2048 Sep 24 12:57
> > > config
> >
> > Yaffs has some crazy defaults for 'mode' on root and
> > lost+found dirs on a new filesystem. AFAIK once you set
> > them (chmod) they are persistant.
>
> They don't seem to be. Not reliably on our boards anyway. We
> have to have a chmod 755 in the init scripts otherwise all
> sorts of mysterious breakage occurs from programs that can't
> read /etc/passwd or /var/foo (more accurately I think they
> can't enumerate directories).


We don't use Yaffs for root, but for two other filesystems.
These are set to 0755 when we install them, then we don't
touch them again (on mount), so perhaps root is different
somehow.

What about your yaffs' lost+found dir mode?

> The setting sometimes sticks. I have not yet been able to
> determine why it sometimes gets lost and why it sometimes
> doesn't. It could easily be an interaction with our
> yaffs-aware bootloader.


Try this patch. It's not something I've looked at much, just
a change I have in my scratch/sandbox for something I noticed
a while ago. If it fixes things be sure to let me know.

===================================================================
RCS file: /home/aleph1/cvs/yaffs2/yaffs_guts.c,v
retrieving revision 1.51
diff -u -I ''\''$Id'\''' -I ''\''$Revision'\''' -r1.51 yaffs_guts.c
--- yaffs_guts.c        23 Jul 2007 05:14:08 -0000      1.51
+++ yaffs_guts.c        24 Sep 2007 16:11:51 -0000
@@ -2167,6 +2167,7 @@
 #endif
                switch (type) {
                case YAFFS_OBJECT_TYPE_FILE:
+                       theObject->yst_mode = YAFFS_NEWOBJECT_MODE;
                        theObject->variant.fileVariant.fileSize = 0;
                        theObject->variant.fileVariant.scannedFileSize = 0;
                        theObject->variant.fileVariant.shrinkSize = 0xFFFFFFFF;/* max __u32 */



===========