From: Artem Bityutskiy <dedekind1@gmail.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: linux-mtd@lists.infradead.org,
Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Subject: Re: [PATCH] jffs2: Do not assume erase will fail
Date: Mon, 25 Oct 2010 11:01:49 +0300 [thread overview]
Message-ID: <1287993709.2224.6.camel@localhost> (raw)
In-Reply-To: <1287965485.5674.25.camel@macbook.infradead.org>
On Mon, 2010-10-25 at 01:11 +0100, David Woodhouse wrote:
> On Thu, 2010-10-07 at 18:29 +0200, Joakim Tjernlund wrote:
> >
> > Test if it did and then abort.
> >
> > Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
> > ---
> > fs/jffs2/nodemgmt.c | 6 +++---
> > 1 files changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/fs/jffs2/nodemgmt.c b/fs/jffs2/nodemgmt.c
> > index 694aa5b..49ee5de 100644
> > --- a/fs/jffs2/nodemgmt.c
> > +++ b/fs/jffs2/nodemgmt.c
> > @@ -260,9 +260,9 @@ static int jffs2_find_nextblock(struct jffs2_sb_info *c)
> > spin_lock(&c->erase_completion_lock);
> >
> > /* An erase may have failed, decreasing the
> > - amount of free space available. So we must
> > - restart from the beginning */
> > - return -EAGAIN;
> > + amount of free space available. */
> > + if (list_empty(&c->free_list))
> > + return -EAGAIN; /* restart from the beginning */
>
> Hm, but there could have been more than one erase pending (or in
> progress). And if one fails and another succeeds then you could have a
> non-empty free_list but you could *also* now have run short of
> free/freeable space so that a userspace write should now receive
> -ENOSPC.
>
> Is this really a performance issue? It should just come straight back if
> the conditions are still met, surely?
>
> And if we're hitting this code path that often, we should look at
> erasing more aggressively so that we *don't* have to erase stuff on
> demand.
David,
there are 2 patches which you seem to miss. I've re-based my l2 tree
against your today's mtd tree, and applied them on top. I've also
preserved this patch. Please, look at those.
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
next prev parent reply other threads:[~2010-10-25 8:04 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-07 16:29 [PATCH] jffs2: Do not assume erase will fail Joakim Tjernlund
2010-10-12 8:48 ` Artem Bityutskiy
2010-10-25 0:11 ` David Woodhouse
2010-10-25 6:49 ` Joakim Tjernlund
2010-10-25 9:50 ` David Woodhouse
2010-10-25 10:01 ` Joakim Tjernlund
2010-10-25 8:01 ` Artem Bityutskiy [this message]
2010-10-25 10:56 ` David Woodhouse
2010-10-25 11:00 ` Joakim Tjernlund
2010-10-25 11:01 ` David Woodhouse
2010-10-25 11:03 ` Joakim Tjernlund
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=1287993709.2224.6.camel@localhost \
--to=dedekind1@gmail.com \
--cc=Joakim.Tjernlund@transmode.se \
--cc=dwmw2@infradead.org \
--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;
as well as URLs for NNTP newsgroup(s).