All of lore.kernel.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: Hyunchul Lee <hyc.lee@gmail.com>, Richard Weinberger <richard@nod.at>
Cc: linux-mtd@lists.infradead.org, kernel-team@lge.com
Subject: Re: [PATCH 0/3] ubifs: add lz4hc compression
Date: Fri, 03 Mar 2017 14:00:38 +0200	[thread overview]
Message-ID: <1488542438.3583.107.camel@gmail.com> (raw)
In-Reply-To: <58B94E55.3080209@gmail.com>

On Fri, 2017-03-03 at 20:07 +0900, Hyunchul Lee wrote:
> yes, ubifs detects this. but I mean that if another compression type
> except lz4hc
> is added, ubifs cannot. because ubifs_iget() assigns ubifs_ino_node's
> compr_type(16-bit) 
> to ubifs_inode's compr_type(2-bit).
> I guess that the disk format version should be incremented.

Let's say that some day in the future you add the new XYZ compression
support, and its type is 5. Let's say the new compressor is supported
in kernel version 5.0.

Now I get your device which is running kernel 5.0 and uses XYZ
compression. I downgrade the kernel to version 4.0 on this device, v4.0
does not support XYZ. What happens?

Well, not a very good thing. UBIFS will read the inode, truncate
compr_type in ubifs_iget():

        ui->compr_type  = le16_to_cpu(ino->compr_type);

and happily continue, and later on failing to decompress.

Is this ideal? No. But we can lessen the future problem by making
compr_type to be full u16 already today.

Should we change on-flash format? I think no, because UBIFS will still
fail when it tries to decompress.

Artem.

  reply	other threads:[~2017-03-03 12:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-28  5:16 [PATCH 0/3] ubifs: add lz4hc compression Hyunchul Lee
2017-02-28  5:16 ` [PATCH 1/3] ubifs: add lz4hc compressor Hyunchul Lee
2017-02-28  5:16 ` [PATCH 2/3] ubifs: change type of ubifs_inode's compr_type to unsigend:16 Hyunchul Lee
2017-02-28 10:17 ` [PATCH 0/3] ubifs: add lz4hc compression Artem Bityutskiy
2017-03-01  1:12   ` Hyunchul Lee
2017-03-01 10:35     ` Artem Bityutskiy
2017-03-03  8:08 ` Richard Weinberger
2017-03-03 11:07   ` Hyunchul Lee
2017-03-03 12:00     ` Artem Bityutskiy [this message]
2017-03-03 12:07       ` Richard Weinberger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1488542438.3583.107.camel@gmail.com \
    --to=dedekind1@gmail.com \
    --cc=hyc.lee@gmail.com \
    --cc=kernel-team@lge.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richard@nod.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.