From: Adrian Hunter Date: Wed, 23 Jul 2008 13:55:55 +0000 (+0300) Subject: UBIFS: correct orphan deletion order X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=f769108424a19c7758546d1d7d19f098b1a33759;p=linux-beck.git UBIFS: correct orphan deletion order The debug function that checks orphans, does so using the TNC mutex. That means it will not see a correct picture if the inode is removed from the orphan tree before it is removed from TNC. Signed-off-by: Adrian Hunter --- diff --git a/fs/ubifs/journal.c b/fs/ubifs/journal.c index 25de6fde383f..acdae00aaa54 100644 --- a/fs/ubifs/journal.c +++ b/fs/ubifs/journal.c @@ -871,10 +871,11 @@ int ubifs_jnl_delete_inode(struct ubifs_info *c, const struct inode *inode) return ubifs_jnl_write_inode(c, inode); } - ubifs_delete_orphan(c, inode->i_ino); err = ubifs_tnc_remove_ino(c, inode->i_ino); if (err) ubifs_ro_mode(c, err); + else + ubifs_delete_orphan(c, inode->i_ino); up_read(&c->commit_sem); return err; }