]> git.ipfire.org Git - people/ms/linux.git/commit
xfs: ensure buffer types are set correctly
authorDave Chinner <dchinner@redhat.com>
Wed, 21 Jan 2015 22:29:05 +0000 (09:29 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Mar 2015 22:57:15 +0000 (14:57 -0800)
commitaa7583d3c12bfc896f36ec06759aa42c29f14f85
tree5034cf8a7067519107e7fad1eeffff230909fff2
parent8a3f71b3e173ef8be1200d29b8691b2d8ddd5681
xfs: ensure buffer types are set correctly

commit 0d612fb570b71ea2e49554a770cff4c489018b2c upstream.

Jan Kara reported that log recovery was finding buffers with invalid
types in them. This should not happen, and indicates a bug in the
logging of buffers. To catch this, add asserts to the buffer
formatting code to ensure that the buffer type is in range when the
transaction is committed.

We don't set a type on buffers being marked stale - they are not
going to get replayed, the format item exists only for recovery to
be able to prevent replay of the buffer, so the type does not
matter. Hence that needs special casing here.

Reported-by: Jan Kara <jack@suse.cz>
Tested-by: Jan Kara <jack@suse.cz>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/xfs/xfs_buf_item.c