Skip to content
Commit 8f443e23 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Revert "ocfs2: incorrect check for debugfs returns"



This reverts commit e2ac55b6.

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: default avatarHuang Ying <ying.huang@intel.com>
Acked-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Acked-by: default avatarChengyu Song <csong84@gatech.edu>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 646da631
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment