summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ioctl.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2011-07-27 22:13:10 +0200
committerChris Mason <chris.mason@oracle.com>2011-07-27 22:18:13 +0200
commitff95acb6733d41a8d45feb0e18b96df25e610e78 (patch)
treee20983c579c9095970aefa9cb176a9df0654d1e4 /fs/btrfs/ioctl.c
parentLinux 3.0 (diff)
parentBtrfs: make sure reserve_metadata_bytes doesn't leak out strange errors (diff)
downloadlinux-ff95acb6733d41a8d45feb0e18b96df25e610e78.tar.xz
linux-ff95acb6733d41a8d45feb0e18b96df25e610e78.zip
Merge branch 'integration' into for-linus
Diffstat (limited to 'fs/btrfs/ioctl.c')
-rw-r--r--fs/btrfs/ioctl.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index a3c4751e07db..fd252fff4c66 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -867,8 +867,8 @@ again:
/* step one, lock all the pages */
for (i = 0; i < num_pages; i++) {
struct page *page;
- page = grab_cache_page(inode->i_mapping,
- start_index + i);
+ page = find_or_create_page(inode->i_mapping,
+ start_index + i, GFP_NOFS);
if (!page)
break;
@@ -938,7 +938,9 @@ again:
GFP_NOFS);
if (i_done != num_pages) {
- atomic_inc(&BTRFS_I(inode)->outstanding_extents);
+ spin_lock(&BTRFS_I(inode)->lock);
+ BTRFS_I(inode)->outstanding_extents++;
+ spin_unlock(&BTRFS_I(inode)->lock);
btrfs_delalloc_release_space(inode,
(num_pages - i_done) << PAGE_CACHE_SHIFT);
}