All of lore.kernel.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: hujianyang <hujianyang@huawei.com>
Cc: linux-mtd <linux-mtd@lists.infradead.org>
Subject: Re: ubifs: replay log error
Date: Sun, 29 Jun 2014 17:14:05 +0300	[thread overview]
Message-ID: <1404051245.3954.40.camel@sauron.fi.intel.com> (raw)
In-Reply-To: <1404049196.3954.35.camel@sauron.fi.intel.com>

On Sun, 2014-06-29 at 16:39 +0300, Artem Bityutskiy wrote:
> On Thu, 2014-06-19 at 16:57 +0800, hujianyang wrote:
> > I found there might be a race in do_commit(). If we perform
> > ubifs_log_end_commit() before write master node, another
> > process which run ubifs_add_bud_to_log() may destroy the
> > old cs_node in the next or latter leb. Because log_end_commit()
> > will change @c->ltail_lnum by new @ltail_lnum. If power off
> > happens before we write either master node, we will read the
> > old master nodes and find no cs node exist in the leb which
> > master node indicate in the next mount.
> > 
> > Am I right?
> 
> Frankly, I did not fully understand your explanation, but after spending
> some time looking at the code and trying to recall what is going on
> there, I see the race condition.
> 
> Excellent analysis, well done, thank you!
> 
> > Now I would like to show the undone patch.
> 
> Not sure this patch is the best way to fix the issue.
> 
> How about the following patch (also attached), which I did not test, and
> did not even compile-check.

Scratch that, let me re-send patches which compile.

-- 
Best Regards,
Artem Bityutskiy

      reply	other threads:[~2014-06-29 14:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-10  9:15 ubifs: replay log error hujianyang
2014-06-19  8:38 ` hujianyang
2014-06-19  8:57 ` hujianyang
2014-06-24 12:42   ` hujianyang
2014-06-29 13:39   ` Artem Bityutskiy
2014-06-29 14:14     ` 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=1404051245.3954.40.camel@sauron.fi.intel.com \
    --to=dedekind1@gmail.com \
    --cc=hujianyang@huawei.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.