debugfs: fix encoding handling in dx_hash command
commita00377899842f58e750b375c8273d1df79edf7bc
authorEric Biggers <ebiggers@google.com>
Mon, 29 Apr 2019 00:35:21 +0000 (28 20:35 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 29 Apr 2019 00:35:25 +0000 (28 20:35 -0400)
treeeeffb71f78fb961881061d9ea3f91e221c74ad84
parent9033a31e261ebf86d8255afe94cde366677d578c
debugfs: fix encoding handling in dx_hash command

Fix the following bugs:

1. 'encoding' and 'hash_flags' are not initialized, causing a segfault.

2. 'hash_flags' incorrectly uses a __bitwise type.

3. The optstring doesn't contain "c" or "e", so the -c and -e options
   aren't recognized.

4. The code that handles the -e option always returns.

Fixes: ef733f1a97ec ("debugfs: support encoding when printing the file hash")
Reviewed-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
debugfs/htree.c