aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fusionio.com>2013-01-30 14:31:31 -0500
committerJosef Bacik <jbacik@fusionio.com>2013-02-05 16:09:16 -0500
commit59fe4f41976f6331b695ff049296d082cf621823 (patch)
tree8d85984a12d0a821a402f83558e82561485be65b /fs
parent5d1f40202bad12d4c70a2d40a420b30d23a72b1a (diff)
Btrfs: fix possible stale data exposure
We specifically do not update the disk i_size if there are ordered extents outstanding for any area between the current disk_i_size and our ordered extent so that we do not expose stale data. The problem is the check we have only checks if the ordered extent starts at or after the current disk_i_size, which doesn't take into account an ordered extent that starts before the current disk_i_size and ends past the disk_i_size. Fix this by checking if the extent ends past the disk_i_size. Thanks, Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/ordered-data.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c
index fc6840b53d9d..e5ed56729607 100644
--- a/fs/btrfs/ordered-data.c
+++ b/fs/btrfs/ordered-data.c
@@ -877,7 +877,7 @@ int btrfs_ordered_update_i_size(struct inode *inode, u64 offset,
877 break; 877 break;
878 if (test->file_offset >= i_size) 878 if (test->file_offset >= i_size)
879 break; 879 break;
880 if (test->file_offset >= disk_i_size) { 880 if (entry_end(test) > disk_i_size) {
881 /* 881 /*
882 * we don't update disk_i_size now, so record this 882 * we don't update disk_i_size now, so record this
883 * undealt i_size. Or we will not know the real 883 * undealt i_size. Or we will not know the real