diff options
author | Nikolay Borisov <nborisov@suse.com> | 2019-08-22 17:25:23 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2019-09-09 14:59:13 +0200 |
commit | e8e210075a901aac577fd33619509dfb21a07071 (patch) | |
tree | ee149d3279baae1dc29129417363acf3950db79b | |
parent | 922f0518249d20d00ba11470331a2c89b6749c91 (diff) | |
download | linux-e8e210075a901aac577fd33619509dfb21a07071.tar.gz linux-e8e210075a901aac577fd33619509dfb21a07071.tar.bz2 linux-e8e210075a901aac577fd33619509dfb21a07071.zip |
btrfs: comment and minor simplifications in run_delalloc_nocow
Add a comment explaining why we keep the BUG also use the already read
and cached value of extent ram bytes stored in 'ram_bytes'.
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r-- | fs/btrfs/inode.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index aece5dd0e7a8..90c6a4813a19 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -1503,16 +1503,15 @@ next_slot: goto out_check; nocow = true; } else if (extent_type == BTRFS_FILE_EXTENT_INLINE) { - extent_end = found_key.offset + - btrfs_file_extent_ram_bytes(leaf, fi); - extent_end = ALIGN(extent_end, - fs_info->sectorsize); + extent_end = found_key.offset + ram_bytes; + extent_end = ALIGN(extent_end, fs_info->sectorsize); /* Skip extents outside of our requested range */ if (extent_end <= start) { path->slots[0]++; goto next_slot; } } else { + /* If this triggers then we have a memory corruption */ BUG(); } out_check: |