]> git.baikalelectronics.ru Git - kernel.git/commit
Revert "ocfs2: incorrect check for debugfs returns"
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 21 Apr 2015 16:17:28 +0000 (09:17 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 21 Apr 2015 16:17:28 +0000 (09:17 -0700)
commit2f5adbf811753da12386358e13c29e56c66299df
tree45491c137f2d684a49a1f01046f1eda6398e2aac
parent57c86cf24dc73b893aa0d0bb6fc3b052a0d0dc73
Revert "ocfs2: incorrect check for debugfs returns"

This reverts commit 72c5d8c6697629a8b8c91f2c6be45a47f7df5a2c.

Huang Ying reports that this causes a hang at boot with debugfs disabled.

It is true that the debugfs error checks are kind of confusing, and this
code certainly merits more cleanup and thinking about it, but there's
something wrong with the trivial "check not just for NULL, but for error
pointers too" patch.

Yes, with debugfs disabled, we will end up setting the o2hb_debug_dir
pointer variable to an error pointer (-ENODEV), and then continue as if
everything was fine.  But since debugfs is disabled, all the _users_ of
that pointer end up being compiled away, so even though the pointer can
not be dereferenced, that's still fine.

So it's confusing and somewhat questionable, but the "more correct"
error checks end up causing more trouble than they fix.

Reported-by: Huang Ying <ying.huang@intel.com>
Acked-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Chengyu Song <csong84@gatech.edu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/ocfs2/cluster/heartbeat.c
fs/ocfs2/dlmglue.c
fs/ocfs2/super.c