diff options
author | David Sterba <dsterba@suse.cz> | 2013-02-15 11:31:02 -0700 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2013-02-15 16:57:47 -0500 |
commit | 6f60cbd3ae442cb35861bb522f388db123d42ec1 (patch) | |
tree | 8cdca02d09d86f1e26b9a030ac39aa3675e2cd01 /fs/btrfs/delayed-ref.c | |
parent | 2a745b14bc99d52c29d0c886a110321f651cf183 (diff) | |
download | blackbird-op-linux-6f60cbd3ae442cb35861bb522f388db123d42ec1.tar.gz blackbird-op-linux-6f60cbd3ae442cb35861bb522f388db123d42ec1.zip |
btrfs: access superblock via pagecache in scan_one_device
btrfs_scan_one_device is calling set_blocksize() which can race
with a concurrent process making dirty page cache pages. It can end up
dropping dirty page cache pages on the floor, which isn't very nice when
someone is just running btrfs dev scan to find filesystems on the
box.
Now that udev is registering btrfs devices as it discovers them, we can
actually end up racing with our own mkfs program too. When this
happens, we drop some of the important blocks written by mkfs.
This commit changes scan_one_device to read the super out of the page
cache instead of trying to use bread. This way we don't have to care
about the blocksize of the device.
This also drops the invalidate_bdev() call. It wasn't very polite to
invalidate during the scan either. mkfs is putting the super into the
page cache, there's no reason to invalidate at this point.
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs/delayed-ref.c')
0 files changed, 0 insertions, 0 deletions