]> www.infradead.org Git - users/jedix/linux-maple.git/commit
Btrfs: only set cache_generation if we setup the block group
authorJosef Bacik <josef@redhat.com>
Tue, 13 Dec 2011 21:04:54 +0000 (16:04 -0500)
committerChris Mason <chris.mason@oracle.com>
Fri, 16 Dec 2011 19:56:04 +0000 (14:56 -0500)
commitc7224502124be9b4c271ed5c546441b82cf6e7b5
treeead3971cd1edeec4c93345f572b80e29138b1536
parent2d524473836cb777e8b67b6925577c38b2940624
Btrfs: only set cache_generation if we setup the block group

A user reported a problem booting into a new kernel with the old format inodes.
He was panicing in cow_file_range while writing out the inode cache.  This is
because if the block group is not cached we'll just skip writing out the cache,
however if it gets dirtied again in the same transaction and it finished caching
we'd go ahead and write it out, but since we set cache_generation to the transid
we think we've already truncated it and will just carry on, running into
cow_file_range and blowing up.  We need to make sure we only set
cache_generation if we've done the truncate.  The user tested this patch and
verified that the panic no longer occured.  Thanks,

Reported-and-Tested-by: Klaus Bitto <klaus.bitto@gmail.com>
Signed-off-by: Josef Bacik <josef@redhat.com>
(cherry picked from commit e65cbb94e036058128a5dec6398be2fd64cf88ba)
fs/btrfs/extent-tree.c