Gregory CLEMENT | 6 Sep 17:38
Picon

Exporting jffs2 by nfs with kernel 2.6

Hi all,

On 2.4.18 we managed to export a jffs2 filesystem by nfs.
Now on 2.6.16 we can't.
I found 2 problems for it:
First, changed was made in nfs, and now they test if
s_export_op is not a void pointer. By dding a pointer on
this structure (even this structure is void) makes nfs happy.
If the structure is void nfs use generic function, so for this part
I think it's ok

Second, nfs need to identify the filesystem to export. It is done
either by the device of the filesystem or by a "fsid". I didfn't see any
filesystem use a "fsid" and I don't know how to use it. So identification
is made if FS_REQUIRES_DEV is set. The problem was in kernel 2.5.7,
this flag was removed because "We never really used the block device anyway".
Do you mind setting this flag again? Or have you a better idea?

I joined my patch which make jffs2 exportable by nfs:

--

-- 
Gregory CLEMENT
Adeneo
Index: linux-2.6.16/fs/jffs2/super.c
===================================================================
diff -u -r1.1 -r1.2
--- linux-2.6.16/fs/jffs2/super.c	6 Jun 2006 16:18:24 -0000	1.1
+++ linux-2.6.16/fs/jffs2/super.c	6 Sep 2006 14:14:37 -0000	1.2
(Continue reading)

David Howells | 20 Sep 20:24
Picon
Favicon

[PATCH][RFC] Abstract MTD mounting from JFFS2 and add super_block::s_mtd


Abstract MTD mounting from JFFS2 so that it can be used by other filesystems
(such as ROMFS for MTD which is being developed).

This patch:

 (1) Creates get_sb_mtd() and kill_mtd_super() functions as analogues of the
     blockdev ones.  These functions live in the MTD core module rather than in
     fs/super.c because they require access to MTD facilities, and in any case
     only MTD-dependent code may use them.

     A new header file <linux/mtd/super.h> is provided for access to them.

 (2) Adds s_mtd to struct super_block as an analogue of s_bdev.  This is used
     to hold a pointer to the MTD device structure used by a superblock instead
     of a blockdev pointer.  It is also used to compare superblocks during
     mounting, as for blockdevs.

     This change shouldn't add all that much overhead since it adds a single
     pointer to the super_block struct, and there shouldn't be all that many of
     those in a system.

 (3) Removes the corresponding code from JFFS2 and has JFFS2 use the new
     facility instead.

I've considered putting s_bdev and s_mtd in an anonymous union together.  For
the most part this wouldn't be a problem as no filesystems use both and most of
the generic code follows suit.  However, there are a couple of places where
s_bdev is used if non-NULL without checking that it's a blockdev, and I'm not
sure how I'd deal with those as I'm not sure how else to check that a
(Continue reading)

Spencer Shanson | 26 Sep 01:37
Picon
Favicon

Writes failing on JFFS2

I've been having some problems updating files on a JFFS2 partition. I
wrote the following simple test script to verify the problem:

#!/bin/sh
I=1
while [ 1 ]; do
    echo "----> $I"
    echo "Run $I " >>/nvram/foo
    I=`expr $I + 1`
done

As you can see, all it does is keep appending to a file in /nvram, which
is our JFFS2 mount point. I run the script after erasing the nvram
partition and after 217 times through the loop the writes to /nvram/foo
start failing. This is very consistent on multiple boards.

The JFFS2 paritition is created with 6 contiguous 64KB sectors. It's
created with the following command:
flash_erase /dev/mtd/5 0 6

I want this partition to be initially empty, so I don't have a
mkfs.jffs2-created file to copy over, but just for completeness I tried
creating one and I got similar results.

I'm running uClinux with the 2.4.22 kernel. To provide more information
I enabled the debugging output in JFFS2, and here's the output around
the time of the error. As you can see, loop 217 writes OK, but loop 218
returns -ENOSPC.

Does anyone have any clues as to what I could be doing wrong here?
(Continue reading)

Jonas Holmberg | 26 Sep 09:34
Picon
Favicon

Re: Writes failing on JFFS2

Spencer Shanson wrote:

> The JFFS2 paritition is created with 6 contiguous 64KB sectors.

I think you need to increase that to 8 sectors for JFFS2 to work properly.

/Jonas

PS. Discussions about JFFS2 takes place at linux-mtd <at> lists.infradead.org

To unsubscribe from this list: send the line "unsubscribe jffs-dev" in
the body of a message to majordomo <at> axis.com


Gmane