]> git.baikalelectronics.ru Git - kernel.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)
committerJosef Bacik <josef@redhat.com>
Thu, 15 Dec 2011 16:04:24 +0000 (11:04 -0500)
commit0c2b6a802c3f3e474192fb933168ed927f394376
tree1ad4bba788cc283545d1e240c529eadeab7155aa
parent03fa0b93f3eaef98068bbbffc3f8d4ed4d2a8e8c
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>
fs/btrfs/extent-tree.c