diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-07-18 12:01:11 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:04:05 -0400 |
commit | 7f3c74fb831fa19bafe087e817c0a5ff3883f1ea (patch) | |
tree | 416e95db10e408240916d5061caf1e5d1182b330 /fs/btrfs/file-item.c | |
parent | 211f90e68b679d27fe23c5505f86d6ce62c98bae (diff) |
Btrfs: Keep extent mappings in ram until pending ordered extents are done
It was possible for stale mappings from disk to be used instead of the
new pending ordered extent. This adds a flag to the extent map struct
to keep it pinned until the pending ordered extent is actually on disk.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/file-item.c')
-rw-r--r-- | fs/btrfs/file-item.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c index e02f1e5acb0a..d9c69e16d368 100644 --- a/fs/btrfs/file-item.c +++ b/fs/btrfs/file-item.c | |||
@@ -192,7 +192,6 @@ int btrfs_csum_one_bio(struct btrfs_root *root, struct inode *inode, | |||
192 | (char *)§or_sum->sum); | 192 | (char *)§or_sum->sum); |
193 | sector_sum->offset = page_offset(bvec->bv_page) + | 193 | sector_sum->offset = page_offset(bvec->bv_page) + |
194 | bvec->bv_offset; | 194 | bvec->bv_offset; |
195 | |||
196 | sector_sum++; | 195 | sector_sum++; |
197 | bio_index++; | 196 | bio_index++; |
198 | total_bytes += bvec->bv_len; | 197 | total_bytes += bvec->bv_len; |
@@ -201,9 +200,6 @@ int btrfs_csum_one_bio(struct btrfs_root *root, struct inode *inode, | |||
201 | } | 200 | } |
202 | btrfs_add_ordered_sum(inode, ordered, sums); | 201 | btrfs_add_ordered_sum(inode, ordered, sums); |
203 | btrfs_put_ordered_extent(ordered); | 202 | btrfs_put_ordered_extent(ordered); |
204 | if (total_bytes != bio->bi_size) { | ||
205 | printk("warning, total bytes %lu bio size %u\n", total_bytes, bio->bi_size); | ||
206 | } | ||
207 | return 0; | 203 | return 0; |
208 | } | 204 | } |
209 | 205 | ||
@@ -372,6 +368,7 @@ next_sector: | |||
372 | write_extent_buffer(leaf, §or_sum->sum, | 368 | write_extent_buffer(leaf, §or_sum->sum, |
373 | (unsigned long)item, BTRFS_CRC32_SIZE); | 369 | (unsigned long)item, BTRFS_CRC32_SIZE); |
374 | } | 370 | } |
371 | |||
375 | total_bytes += root->sectorsize; | 372 | total_bytes += root->sectorsize; |
376 | sector_sum++; | 373 | sector_sum++; |
377 | if (total_bytes < sums->len) { | 374 | if (total_bytes < sums->len) { |