]> www.infradead.org Git - users/jedix/linux-maple.git/commit
xfs: Fix file type directory corruption for btree directories
authorJan Kara <jack@suse.com>
Tue, 25 Aug 2015 00:05:13 +0000 (10:05 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Sep 2015 17:05:37 +0000 (10:05 -0700)
commit533f267763456f75d57bd590830629bf28fe3d8c
tree79eef6fd9c9a04d63438a9b3a36abd24e467c8f6
parent39516016709f4bf72d6e4c12089bbae7b1432ba7
xfs: Fix file type directory corruption for btree directories

commit 037542345a82aaaa228ec280fe6ddff1568d169f upstream.

Users have occasionally reported that file type for some directory
entries is wrong. This mostly happened after updating libraries some
libraries. After some debugging the problem was traced down to
xfs_dir2_node_replace(). The function uses args->filetype as a file type
to store in the replaced directory entry however it also calls
xfs_da3_node_lookup_int() which will store file type of the current
directory entry in args->filetype. Thus we fail to change file type of a
directory entry to a proper type.

Fix the problem by storing new file type in a local variable before
calling xfs_da3_node_lookup_int().

Reported-by: Giacomo Comes <comes@naic.edu>
Signed-off-by: Jan Kara <jack@suse.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/xfs/libxfs/xfs_dir2_node.c