All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: brijesh.singh@calsoftinc.com
Cc: Brijesh Singh <brijesh.s.singh@gmail.com>, linux-mtd@lists.infradead.org
Subject: Re: Why is PEB not erased before writing???
Date: Tue, 20 Feb 2007 11:44:19 +0100	[thread overview]
Message-ID: <1171968259.30834.229.camel@localhost.localdomain> (raw)
In-Reply-To: <44602.172.16.0.34.1171964998.squirrel@webmail.calsoftinc.com>

On Tue, 2007-02-20 at 15:19 +0530, brijesh.singh@calsoftinc.com wrote:
> > Applications and UBI kernel users have no access to physical erase
> > blocks. They look at logical erase blocks. UBI manages the translation
> > of logical to physical blocks. If you write to the same logical erase
> > block again UBI will just write to a different physical erase block and
> > erase the previous PEB later on. The internal management guarantees that
> > the application looks only at the newest written block and not at the
> > older one.
> 
> Yes this is what I thought it should do.If LEB is mapped to a dirty PEB
> remap it and wl daemon will erase it.But it doesn't.
> But here is the scenario
> Steps
>      *I made a 2MB ubi volume
>      *Total mtd device size is 3MB
>      *I wrote a 2MB file to UBI using "dd if=file of=/dev/ubi_vol"
>      *Now device is full
>      *Again I did the same thing.
>      *Now theoretically erase should have been called,by wl or eba module
>      *But it directly over-writes the device.
> I am using mtdram to test if erase is called.Nop,it is not.
> Cdev write interface calls eba_write which doesn't check if block is
> already written.And it over-writes it with no call to erase.
> Now what to do?Erase is not even called!

Did you enable CONFIG_MTD_USERSPACE_IO ? If yes, then the behaviour is
clear. This is a _DEBUG_ option and bypasses the normal update
procedure.

	tglx

  reply	other threads:[~2007-02-20 10:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-20  6:37 Why is PEB not erased before writing??? Brijesh Singh
2007-02-20  9:34 ` Thomas Gleixner
2007-02-20  9:49   ` brijesh.singh
2007-02-20 10:44     ` Thomas Gleixner [this message]
2007-02-20 11:08       ` Brijesh Singh
2007-02-20 11:11       ` Brijesh Singh
2007-02-20 11:17         ` Thomas Gleixner
2007-02-20 21:48           ` Gavin Lambert
2007-02-20 22:29             ` Thomas Gleixner

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=1171968259.30834.229.camel@localhost.localdomain \
    --to=tglx@linutronix.de \
    --cc=brijesh.s.singh@gmail.com \
    --cc=brijesh.singh@calsoftinc.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 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.