UBIFS: do not read flash unnecessarily
commit83d20f1306dc5ce76f195917dead2ce30351d2fb
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Fri, 25 Mar 2011 16:33:57 +0000 (25 18:33 +0200)
committerAndi Kleen <ak@linux.intel.com>
Thu, 28 Apr 2011 15:20:53 +0000 (28 08:20 -0700)
tree9d4df14f096f8bd3b0447fd6d166587d1da06e11
parent7f4353ff07d3fa47f2334d596d83c4465a2960ed
UBIFS: do not read flash unnecessarily

commit 8b229c76765816796eec7ccd428f03bd8de8b525 upstream.

This fix makes the 'dbg_check_old_index()' function return
immediately if debugging is disabled, instead of executing
incorrect 'goto out' which causes UBIFS to:

1. Allocate memory
2. Read the flash

On every commit. OK, we do not commit that often, but it is
still silly to do unneeded I/O anyway.

Credits to coverity for spotting this silly issue.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
fs/ubifs/commit.c