public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind@infradead.org>
To: Monte Copeland <catboatmonte@gmail.com>
Cc: linux-mtd@lists.infradead.org
Subject: Re: just wondering about write_leb() in ubi/upd.c
Date: Tue, 30 Sep 2008 08:35:56 +0300	[thread overview]
Message-ID: <1222752956.8051.1.camel@sauron> (raw)
In-Reply-To: <1fc50b580809291135s3dbf8269ga12917d1b0b65e9e@mail.gmail.com>

Hi,

On Mon, 2008-09-29 at 13:35 -0500, Monte Copeland wrote:
> I just fixed a bug in our older UBI version and decided to check the
> upstream.  Looking at the latest from kernel.org,
> I see in the write_leb() function in ubi/upd.c:
> 
>         if (vol->vol_type == UBI_DYNAMIC_VOLUME) {
>                 len = ALIGN(len, ubi->min_io_size);
>                 memset(buf + len, 0xFF, len - len);   <---- memset zero bytes?
> 
>                 len = ubi_calc_data_len(ubi, buf, len);
>                 if (len == 0) {
>                         dbg_msg("all %d bytes contain 0xFF - skip", len);
>                         return 0;
>                 }
> 
>                 err = ubi_eba_write_leb(ubi, vol, lnum, buf, 0, len,
> UBI_UNKNOWN);
>         } else {

Monte,

thanks for the report, but we fixed this already and the fix will show
up in 2.6.28. See

commit a0fd1efd488092951f310fdb777b8a540cf84dcb
Author: Kyungmin Park <kmpark@infradead.org>
Date:   Wed May 21 14:34:56 2008 +0300

    UBI: fix buffer padding

    Instead of correctly pad the buffer wich we are writing to the
    eraseblock during update, we used weird construct:

    memset(buf + len, 0xFF, len - len);

    Fix this.

    Signed-off-by: Kyungmin Park <kmpark@infradead.org>
    Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>

-- 
Best regards,
Artem Bityutskiy (Битюцкий Артём)

      reply	other threads:[~2008-09-30  5:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-29 18:35 just wondering about write_leb() in ubi/upd.c Monte Copeland
2008-09-30  5:35 ` Artem Bityutskiy [this message]

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=1222752956.8051.1.camel@sauron \
    --to=dedekind@infradead.org \
    --cc=catboatmonte@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox