Bug fix for uid/gid in jffs2

David Woodhouse dwmw2 at infradead.org
Wed Mar 1 01:29:13 PST 2017


On Wed, 2017-03-01 at 16:44 +0800, yangshukui wrote:
> 
> @@ -146,8 +146,8 @@ struct jffs2_raw_inode
>       jint32_t ino;        /* Inode number.  */
>       jint32_t version;    /* Version number.  */
>       jmode_t mode;       /* The file's type or mode.  */
> -    jint16_t uid;        /* The file's owner.  */
> -    jint16_t gid;        /* The file's group.  */
> +    jint32_t uid;        /* The file's owner.  */
> +    jint32_t gid;        /* The file's group.  */

This is changing the binary data structures on the flash, and breaking
compatibility with all existing file systems. Your modified kernel
won't be able to mount existing JFFS2 images.

The way to do this, if we really do need 32-bit ugid support in JFFS2,
is to define a *new* node (JFFS2_NODE_INCOMPAT) type, and then support
reading both. You could even contrive a way to make it
JFFS2_NODE_ROCOMPAT; perhaps a new node type which contains *only* the
(32-bit) ownership information and overrides the 16-bit ones in the
original data nodes? 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 4938 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20170301/fbbdb7e0/attachment-0001.bin>


More information about the linux-mtd mailing list