From: jiangyiwen Date: Fri, 4 Sep 2015 22:44:06 +0000 (-0700) Subject: ocfs2: set filesytem read-only when ocfs2_delete_entry failed. X-Git-Tag: omap-for-v4.3/fixes-rc1~87^2~86 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=807a7907114c7c703017ed7a96477a2eeb0d08e0;p=pandora-kernel.git ocfs2: set filesytem read-only when ocfs2_delete_entry failed. In ocfs2_rename, it will lead to an inode with two entried(old and new) if ocfs2_delete_entry(old) failed. Thus, filesystem will be inconsistent. The case is described below: ocfs2_rename -> ocfs2_start_trans -> ocfs2_add_entry(new) -> ocfs2_delete_entry(old) -> __ocfs2_journal_access *failed* because of -ENOMEM -> ocfs2_commit_trans So filesystem should be set to read-only at the moment. Signed-off-by: Yiwen Jiang Cc: Joseph Qi Cc: Joel Becker Reviewed-by: Mark Fasheh Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed