]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: make sure we update latest_bdev
authorChris Mason <chris.mason@oracle.com>
Tue, 21 Feb 2012 01:53:43 +0000 (20:53 -0500)
committerChris Mason <chris.mason@oracle.com>
Thu, 23 Feb 2012 15:43:45 +0000 (10:43 -0500)
commita1b543f5ee562fca048d6f0817f5af82202924f6
treefc3faaed8b1cf93c7dbe60af4c950be5edd9c8ad
parentb095e2dc6a28e1434040d0bfa3fb9b5e7fde4361
Btrfs: make sure we update latest_bdev

When we are setting up the mount, we close all the
devices that were not actually part of the metadata we found.

But, we don't make sure that one of those devices wasn't
fs_devices->latest_bdev, which means we can do a use after free
on the one we closed.

This updates latest_bdev as it goes.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/disk-io.c
fs/btrfs/volumes.c