Linux-mtd Archive on lore.kernel.org
 help / Atom feed
From: Brandon Maier <brandon.maier@rockwellcollins.com>
To: Richard Weinberger <richard.weinberger@gmail.com>
Cc: Boris Brezillon <bbrezillon@kernel.org>,
	Richard Weinberger <richard@nod.at>,
	Marek Vasut <marek.vasut@gmail.com>,
	linux-mtd@lists.infradead.org,
	Brian Norris <computersforpeace@gmail.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Clayton Shotwell <clayton.shotwell@rockwellcollins.com>
Subject: Re: [PATCH 2/2] jffs2: Add sync to underlying mtd device when file system is synced
Date: Thu, 16 May 2019 10:12:45 -0500
Message-ID: <CA+fik51C43hnuWNFYFfzxivMVFrMZ9hN=jsLbQOWb9qcm0fAxQ@mail.gmail.com> (raw)
In-Reply-To: <CAFLxGvxoO7mMdH5dMKgqzz49qq-M49jSPi5SpmnA1RScgBmj5w@mail.gmail.com>

Clayton is out currently, but I can comment on what he had told me.

On Thu, May 16, 2019 at 6:05 AM Richard Weinberger
<richard.weinberger@gmail.com> wrote:
>
> On Mon, May 6, 2019 at 12:22 AM Richard Weinberger
> <richard.weinberger@gmail.com> wrote:
> >
> > On Fri, May 3, 2019 at 10:14 PM Clayton Shotwell
> > <clayton.shotwell@rockwellcollins.com> wrote:
> > >
> > > Need to ensure the underlying flash does not cache anything even though
> > > the file system thinks it's synced back.
> > >
> > > Signed-off-by: Clayton Shotwell <clayton.shotwell@rockwellcollins.com>
> > > ---
> > >  fs/jffs2/super.c | 1 +
> > >  1 file changed, 1 insertion(+)
> > >
> > > diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c
> > > index 05d892c..4341565 100644
> > > --- a/fs/jffs2/super.c
> > > +++ b/fs/jffs2/super.c
> > > @@ -111,6 +111,7 @@ static int jffs2_sync_fs(struct super_block *sb, int wait)
> > >         mutex_lock(&c->alloc_sem);
> > >         jffs2_flush_wbuf_pad(c);
> > >         mutex_unlock(&c->alloc_sem);
> > > +       mtd_sync(c->mtd);
> >
> > This needs a more detailed explanation.
> > mtd_sync() is not cheap, so you make syncfs() more expensive.
> >
> > Please explain what failure you are facing without mtd_sync().
> > jffs2 is supposed to recover from a power failure at any time, just like ubifs.

The system exhibiting problems runs jffs2 on a gluebi device. Our
software sync()'s the jffs2 at certain points so that it's safe if
power is cut. The jffs2 always recovers the filesystem after power
cut, but sometimes data written before the sync() call gets lost.

These patches attempt to solve this problem by 1) calling _sync() on
the underlying mtd device after writing to flush any buffers in the
mtd, and 2) adding a _sync() callback to gluebi so that if something
syncs the mtd device, we sync any blocks associated with it.

>
> Ping?
>
> --
> Thanks,
> //richard

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply index

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-03 20:13 [PATCH 1/2] mtd: gluebi: Add sync logic Clayton Shotwell
2019-05-03 20:13 ` [PATCH 2/2] jffs2: Add sync to underlying mtd device when file system is synced Clayton Shotwell
2019-05-05 22:22   ` Richard Weinberger
2019-05-16 11:04     ` Richard Weinberger
2019-05-16 15:12       ` Brandon Maier [this message]
2019-05-16 15:31         ` Richard Weinberger

Reply instructions:

You may reply publically 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='CA+fik51C43hnuWNFYFfzxivMVFrMZ9hN=jsLbQOWb9qcm0fAxQ@mail.gmail.com' \
    --to=brandon.maier@rockwellcollins.com \
    --cc=bbrezillon@kernel.org \
    --cc=clayton.shotwell@rockwellcollins.com \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=richard.weinberger@gmail.com \
    --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

Linux-mtd Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mtd/0 linux-mtd/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mtd linux-mtd/ https://lore.kernel.org/linux-mtd \
		linux-mtd@lists.infradead.org linux-mtd@archiver.kernel.org
	public-inbox-index linux-mtd


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-mtd


AGPL code for this site: git clone https://public-inbox.org/ public-inbox