]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ocfs2: access orphan dinode before delete entry in ocfs2_orphan_del
authorJoseph Qi <joseph.qi@huawei.com>
Thu, 14 Jan 2016 23:17:44 +0000 (15:17 -0800)
committerChuck Anderson <chuck.anderson@oracle.com>
Sat, 26 Nov 2016 23:43:26 +0000 (15:43 -0800)
commit96199900d5c1093473e800c43006d5f504980f41
tree3209c5cc7df356ffb2f03eec32c0fdd3717aa2fb
parentd8c43cb23bbb34bc6fe8df4413b4c138d959d5ad
ocfs2: access orphan dinode before delete entry in ocfs2_orphan_del

In ocfs2_orphan_del, currently it finds and deletes entry first, and
then access orphan dir dinode.  This will have a problem once
ocfs2_journal_access_di fails.  In this case, entry will be removed from
orphan dir, but in deed the inode hasn't been deleted successfully.  In
other words, the file is missing but not actually deleted.  So we should
access orphan dinode first like unlink and rename.

Signed-off-by: Joseph Qi <joseph.qi@huawei.com>
Reviewed-by: Jiufei Xue <xuejiufei@huawei.com>
Cc: Mark Fasheh <mfasheh@suse.de>
Cc: Joel Becker <jlbec@evilplan.org>
Reviewed-by: Junxiao Bi <junxiao.bi@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 074a6c655f6da12cb1123c8a84bfd8d781138800)

Orabug: 24939243

Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com>
fs/ocfs2/namei.c