xfs: Fix bug in xfs_dir2_leaf_find_entry() function
commit9515e605d2850512fa8fa725f8edc28b73ce9d53
authorPaulo Alcantara <pcacjr@zytor.com>
Sun, 22 Jul 2012 22:43:53 +0000 (22 19:43 -0300)
committerPaulo Alcantara <pcacjr@zytor.com>
Sun, 22 Jul 2012 22:58:38 +0000 (22 19:58 -0300)
tree63ffdf44881b2d8d5e191b66279bb5dd5aaadba0
parent0a66332f83676b829e034a8a95c329b047cee55a
xfs: Fix bug in xfs_dir2_leaf_find_entry() function

This patch fixes this error:

fs/xfs/xfs.c: In function ‘xfs_iget’:
fs/xfs/xfs.c:685:8: error: ‘hash’ may be used uninitialized in this
     function [-Werror=maybe-uninitialized]
fs/xfs/xfs.c:646:14: note: ‘hash’ was declared here
fs/xfs/xfs.c:811:22: error: ‘mid’ may be used uninitialized in this
      function [-Werror=maybe-uninitialized]

Since hash variable wasn't set to any value by default in
xfs_dir2_leaf_find_entry() function and hashwant would return 0 in a
default case, then the check "if (hash != hashwant)" never would become
true. The same would occur with mid variable and an identical fix has
been provided on this patch.

Also, this patch cleanups the previous commit by removing trailing
whitespaces and moves xfs_da_hashname() and fill_xfs_inode_pvt()
functions to a more readable place.

Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
core/fs/xfs/xfs.c
core/fs/xfs/xfs.h