diff options
author | David Sterba <dsterba@suse.cz> | 2011-10-07 12:06:13 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2012-02-15 10:40:25 -0500 |
commit | 8a3344269465b26761b74493cfbeeaa75d821614 (patch) | |
tree | 31dbc7d96441b95825c70073c769fc7b3f674a75 /fs | |
parent | c08782dacd7a098f2b8bca7f4a57a5b402e9e1e5 (diff) |
btrfs: silence warning in raid array setup
Raid array setup code creates an extent buffer in an usual way. When the
PAGE_CACHE_SIZE is > super block size, the extent pages are not marked
up-to-date, which triggers a WARN_ON in the following
write_extent_buffer call. Add an explicit up-to-date call to silence the
warning.
Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/volumes.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 7ffdb154daec..d8f282b5baa9 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -4357,6 +4357,20 @@ int btrfs_read_sys_array(struct btrfs_root *root) | |||
4357 | return -ENOMEM; | 4357 | return -ENOMEM; |
4358 | btrfs_set_buffer_uptodate(sb); | 4358 | btrfs_set_buffer_uptodate(sb); |
4359 | btrfs_set_buffer_lockdep_class(root->root_key.objectid, sb, 0); | 4359 | btrfs_set_buffer_lockdep_class(root->root_key.objectid, sb, 0); |
4360 | /* | ||
4361 | * The sb extent buffer is artifical and just used to read the system array. | ||
4362 | * btrfs_set_buffer_uptodate() call does not properly mark all it's | ||
4363 | * pages up-to-date when the page is larger: extent does not cover the | ||
4364 | * whole page and consequently check_page_uptodate does not find all | ||
4365 | * the page's extents up-to-date (the hole beyond sb), | ||
4366 | * write_extent_buffer then triggers a WARN_ON. | ||
4367 | * | ||
4368 | * Regular short extents go through mark_extent_buffer_dirty/writeback cycle, | ||
4369 | * but sb spans only this function. Add an explicit SetPageUptodate call | ||
4370 | * to silence the warning eg. on PowerPC 64. | ||
4371 | */ | ||
4372 | if (PAGE_CACHE_SIZE > BTRFS_SUPER_INFO_SIZE) | ||
4373 | SetPageUptodate(sb->first_page); | ||
4360 | 4374 | ||
4361 | write_extent_buffer(sb, super_copy, 0, BTRFS_SUPER_INFO_SIZE); | 4375 | write_extent_buffer(sb, super_copy, 0, BTRFS_SUPER_INFO_SIZE); |
4362 | array_size = btrfs_super_sys_array_size(super_copy); | 4376 | array_size = btrfs_super_sys_array_size(super_copy); |