Skip to content

Commit

Permalink
UBIFS: do not read flash unnecessarily
Browse files Browse the repository at this point in the history
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>
Cc: stable@kernel.org
  • Loading branch information
Artem Bityutskiy authored and Artem Bityutskiy committed Apr 5, 2011
1 parent 0ce790e commit 8b229c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ubifs/commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ int dbg_check_old_index(struct ubifs_info *c, struct ubifs_zbranch *zroot)
size_t sz;

if (!(ubifs_chk_flags & UBIFS_CHK_OLD_IDX))
goto out;
return 0;

INIT_LIST_HEAD(&list);

Expand Down

0 comments on commit 8b229c7

Please sign in to comment.