From: Lars Persson <lists@bofh.nu>
To: Richard Weinberger <richard@nod.at>
Cc: linux-mtd@lists.infradead.org
Subject: Re: UBIFS file-system corruption (missing inode) after power-cut on 4.14.96
Date: Wed, 10 Jul 2019 09:14:51 +0200 [thread overview]
Message-ID: <CADnJP=ssoVB_XJ_hp8LgVipz3uH3PFf6j48NBEHseLnaMiN16g@mail.gmail.com> (raw)
In-Reply-To: <2946812.3xOJdY2bgb@blindfold>
On Fri, Apr 5, 2019 at 3:23 PM Richard Weinberger <richard@nod.at> wrote:
>
> Am Freitag, 5. April 2019, 15:19:31 CEST schrieb Lars Persson:
> > On Thu, Apr 4, 2019 at 11:53 PM Richard Weinberger
> > <richard@sigma-star.at> wrote:
> > > Can you please run your tests again with this patch applied?
> > > It needs further optimization, but we are on the right track.
> > >
> > > diff --git a/fs/ubifs/orphan.c b/fs/ubifs/orphan.c
> > > index 2f1618f300fb..c15e484f73a4 100644
> > > --- a/fs/ubifs/orphan.c
> > > +++ b/fs/ubifs/orphan.c
> > > @@ -691,8 +691,21 @@ static int do_kill_orphans(struct ubifs_info *c, struct ubifs_scan_leb *sleb,
> > > n = (le32_to_cpu(orph->ch.len) - UBIFS_ORPH_NODE_SZ) >> 3;
> > > for (i = 0; i < n; i++) {
> > > union ubifs_key key1, key2;
> > > + struct ubifs_ino_node *ino;
> > > +
> > > + ino = kmalloc(UBIFS_MAX_INO_NODE_SZ, GFP_NOFS);
> > > + if (!ino)
> > > + return -ENOMEM;
> > >
> > > inum = le64_to_cpu(orph->inos[i]);
> > > + ino_key_init(c, &key1, inum);
> > > + err = ubifs_tnc_lookup(c, &key1, ino);
> > > + if (!err && ino->nlink) {
> > > + kfree(ino);
> > > + continue;
> > > + }
> > > + kfree(ino);
> > > +
> > > dbg_rcvry("deleting orphaned inode %lu",
> > > (unsigned long)inum);
> > >
> >
> > Thanks Richard. The power-cut test is OK now with this change. I run
> > it with chk_fs=1 and it passes every time.
>
> Cool, please let it run for some more time, just to be sure.
> I will also do more tests on my side and optimize the patch.
>
> Thanks,
> //richard
>
Richard, we tested this patch for two weeks and saw no further issues.
We can assist again with testing if you make the optimized patch.
Regards,
Lars
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2019-07-10 7:15 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-21 10:02 UBIFS file-system corruption (missing inode) after power-cut on 4.14.96 Lars Persson
2019-03-25 10:21 ` Lars Persson
2019-03-26 9:21 ` Lars Persson
2019-03-28 11:54 ` Lars Persson
2019-03-28 17:31 ` Richard Weinberger
2019-03-29 9:43 ` Lars Persson
2019-04-04 21:31 ` Richard Weinberger
2019-04-04 21:53 ` Richard Weinberger
2019-04-05 13:19 ` Lars Persson
2019-04-05 13:23 ` Richard Weinberger
2019-07-10 7:14 ` Lars Persson [this message]
2019-07-10 9:02 ` Richard Weinberger
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='CADnJP=ssoVB_XJ_hp8LgVipz3uH3PFf6j48NBEHseLnaMiN16g@mail.gmail.com' \
--to=lists@bofh.nu \
--cc=linux-mtd@lists.infradead.org \
--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
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.