Re: UBIFS file-system corruption (missing inode) after power-cut on 4.14.96

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 28, 2019 at 12:54 PM Lars Persson <lists@xxxxxxx> wrote:
>
> On Tue, Mar 26, 2019 at 10:21 AM Lars Persson <lists@xxxxxxx> wrote:
> >
> > On Thu, Mar 21, 2019 at 11:02 AM Lars Persson <lists@xxxxxxx> wrote:
> > >
> > > The missing inode is always triggered on those two particular files
> > > emotiond.conf and tampering.conf that share the same write pattern at startup:
> > >
> > >  cp file file.tmp
> > >  echo some data > file.tmp
> > >  mv file.tmp file
> > >  fsync file
> > >
> >
> > A closer look at that script shows that the atomic file update part
> > was bypassed. It only performs a chown operation on that file.
> > That simple chown will trigger an overlayfs copyup operation.
> >
> > With a proper unmount after the system has finished writing to /etc I
> > cannot reproduce any corruption. An unclean shutdown triggers
> > corruption in about 1/3 of the attempts, also when I cut power tens of
> > seconds after the problematic script has executed.
>
> OK I think I have found the bug.

Thanks for hunting this down!

> Commit 32fe905c17f0 ("Fix O_TMPFILE corner case in ubifs_link()")
> tried to fix the use of O_TMPFILE by removing an inode from the orphan
> list when it is relinked.
>
> Unfortunately the removal never gets committed to flash because the
> removal of an orphan does not trigger a commit. The condition for
> committing is that new_orphans > 0, but in our case it is zero after
> the call to ubifs_delete_orphan().

Can you please share me your corrupted fs?
I'm not so sure what is really the root cause.
The thing is, ubifs_delete_orphan() does not need to tigger a commit.
Ff something depends on a commit, we have another problem, I fear.

-- 
Thanks,
//richard

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



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux