|
@@ -1591,9 +1591,10 @@ again:
|
|
|
unlock_extent_cached(&BTRFS_I(inode)->io_tree,
|
|
|
lockstart, lockend, &cached_state,
|
|
|
GFP_NOFS);
|
|
|
- btrfs_drop_pages(pages, num_pages);
|
|
|
- if (ret)
|
|
|
+ if (ret) {
|
|
|
+ btrfs_drop_pages(pages, num_pages);
|
|
|
break;
|
|
|
+ }
|
|
|
|
|
|
release_bytes = 0;
|
|
|
if (only_release_metadata && copied > 0) {
|
|
@@ -1607,6 +1608,8 @@ again:
|
|
|
only_release_metadata = false;
|
|
|
}
|
|
|
|
|
|
+ btrfs_drop_pages(pages, num_pages);
|
|
|
+
|
|
|
cond_resched();
|
|
|
|
|
|
balance_dirty_pages_ratelimited(inode->i_mapping);
|