[PATCH] jffs2: refactor csize in jffs2_do_read_inode_internal()

Xi Wang xi.wang at gmail.com
Mon Apr 23 02:58:38 EDT 2012


On Apr 23, 2012, at 2:00 AM, Artem Bityutskiy wrote:
> 
> I think JFFS2 has its own limit on the maximum size of the symlink
> target. Probably it is PAGE_CACHE_SIZE, but not sure.

Is it this one?

fs/jffs2/dir.c:297

static int jffs2_symlink (struct inode *dir_i, struct dentry *dentry, const char *target)
{
        ...
        int targetlen = strlen(target);

        /* FIXME: If you care. We'd need to use frags for the target
           if it grows much more than this */
        if (targetlen > 254)
                return -ENAMETOOLONG;
	...

}

I guess the magic value 254 is JFFS2_MAX_NAME_LEN defined in
include/linux/jffs2.h.

- xi


More information about the linux-mtd mailing list