Btrfs: don't use ram_bytes for uncompressed inline items
authorChris Mason <clm@fb.com>
Sat, 4 Jan 2014 05:07:00 +0000 (21:07 -0800)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 27 Nov 2015 12:48:20 +0000 (12:48 +0000)
commit85c36cd4ff9c60b6d3b425b44ccf72c0d2ff0157
tree18b7c3dee4b8c121831855de48116bf9753b64d7
parentdf2ef64a3a36b91e374d7339cf53112f403d6164
Btrfs: don't use ram_bytes for uncompressed inline items

commit 514ac8ad8793a097c0c9d89202c642479d6dfa34 upstream.

If we truncate an uncompressed inline item, ram_bytes isn't updated to reflect
the new size.  The fixe uses the size directly from the item header when
reading uncompressed inlines, and also fixes truncate to update the
size as it goes.

Reported-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>
[bwh: Backported to 3.2:
 - Don't use btrfs_map_token API
 - There are fewer callers of btrfs_file_extent_inline_len() to change
 - Adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/btrfs/ctree.h
fs/btrfs/file.c
fs/btrfs/inode.c
fs/btrfs/print-tree.c
fs/btrfs/tree-log.c