diff options
| author | Liu Bo <bo.li.liu@oracle.com> | 2016-06-03 20:41:42 -0400 |
|---|---|---|
| committer | David Sterba <dsterba@suse.com> | 2016-06-06 04:14:40 -0400 |
| commit | d865177a5e749827f248f6363f5100d3a2f66b0f (patch) | |
| tree | 2c5b0d1c16e2e64f406b309926b176f4458dc599 | |
| parent | 65d4f4c151a5fa7b2dacaaf70def3f95001766d7 (diff) | |
Btrfs: clear uptodate flags of pages in sys_array eb
We set uptodate flag to pages in the temporary sys_array eb,
but do not clear the flag after free eb. As the special
btree inode may still hold a reference on those pages, the
uptodate flag can remain alive in them.
If btrfs_super_chunk_root has been intentionally changed to the
offset of this sys_array eb, reading chunk_root will read content
of sys_array and it will skip our beautiful checks in
btree_readpage_end_io_hook() because of
"pages of eb are uptodate => eb is uptodate"
This adds the 'clear uptodate' part to force it to read from disk.
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
| -rw-r--r-- | fs/btrfs/volumes.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 673c72ab4fbe..42ccde43053b 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
| @@ -6631,12 +6631,14 @@ int btrfs_read_sys_array(struct btrfs_root *root) | |||
| 6631 | sb_array_offset += len; | 6631 | sb_array_offset += len; |
| 6632 | cur_offset += len; | 6632 | cur_offset += len; |
| 6633 | } | 6633 | } |
| 6634 | clear_extent_buffer_uptodate(sb); | ||
| 6634 | free_extent_buffer_stale(sb); | 6635 | free_extent_buffer_stale(sb); |
| 6635 | return ret; | 6636 | return ret; |
| 6636 | 6637 | ||
| 6637 | out_short_read: | 6638 | out_short_read: |
| 6638 | printk(KERN_ERR "BTRFS: sys_array too short to read %u bytes at offset %u\n", | 6639 | printk(KERN_ERR "BTRFS: sys_array too short to read %u bytes at offset %u\n", |
| 6639 | len, cur_offset); | 6640 | len, cur_offset); |
| 6641 | clear_extent_buffer_uptodate(sb); | ||
| 6640 | free_extent_buffer_stale(sb); | 6642 | free_extent_buffer_stale(sb); |
| 6641 | return -EIO; | 6643 | return -EIO; |
| 6642 | } | 6644 | } |
