Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 299822
b: refs/heads/master
c: dc7fdde
h: refs/heads/master
v: v3
  • Loading branch information
Chris Mason committed Apr 27, 2012
1 parent 5c29b6b commit 9c7f283
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fede766f28dd766d4e8feb321fdb19edb21ef6fb
refs/heads/master: dc7fdde39e4962b1a88741f7eba2a6b3be1285d8
9 changes: 7 additions & 2 deletions trunk/fs/btrfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,7 @@ int btrfs_drop_extents(struct btrfs_trans_handle *trans, struct inode *inode,
int extent_type;
int recow;
int ret;
int modify_tree = -1;

if (drop_cache)
btrfs_drop_extent_cache(inode, start, end - 1, 0);
Expand All @@ -575,10 +576,13 @@ int btrfs_drop_extents(struct btrfs_trans_handle *trans, struct inode *inode,
if (!path)
return -ENOMEM;

if (start >= BTRFS_I(inode)->disk_i_size)
modify_tree = 0;

while (1) {
recow = 0;
ret = btrfs_lookup_file_extent(trans, root, path, ino,
search_start, -1);
search_start, modify_tree);
if (ret < 0)
break;
if (ret > 0 && path->slots[0] > 0 && search_start == start) {
Expand Down Expand Up @@ -634,7 +638,8 @@ int btrfs_drop_extents(struct btrfs_trans_handle *trans, struct inode *inode,
}

search_start = max(key.offset, start);
if (recow) {
if (recow || !modify_tree) {
modify_tree = -1;
btrfs_release_path(path);
continue;
}
Expand Down

0 comments on commit 9c7f283

Please sign in to comment.