Skip to content

Commit

Permalink
UBIFS: correct orphan deletion order
Browse files Browse the repository at this point in the history
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 <ext-adrian.hunter@nokia.com>
  • Loading branch information
Adrian Hunter authored and Artem Bityutskiy committed Aug 13, 2008
1 parent 7d62ff2 commit f769108
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/ubifs/journal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit f769108

Please sign in to comment.