aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-01-28 20:00:19 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-28 20:00:19 -0500
commit67d2433ee7aa631bc3ab14c2af6bbc1d44d13a00 (patch)
treeeb29e1489f9f4a99308e08568328de73fb89fc2e /fs/btrfs/inode.c
parent1c36ab1a318ab5b3b502e7e4fff3628d1a97861f (diff)
parent9998eb703490589c3e8f1bf09b15203156776edb (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs: Btrfs: fix reservations in btrfs_page_mkwrite Btrfs: advance window_start if we're using a bitmap btrfs: mask out gfp flags in releasepage Btrfs: fix enospc error caused by wrong checks of the chunk Btrfs: do not defrag a file partially Btrfs: fix warning for 32-bit build of fs/btrfs/check-integrity.c Btrfs: use cluster->window_start when allocating from a cluster bitmap Btrfs: Check for NULL page in extent_range_uptodate btrfs: Fix busyloops in transaction waiting code Btrfs: make sure a bitmap has enough bytes Btrfs: fix uninit warning in backref.c
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 0da19a0ea00d..32214fe0f7e3 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -6401,18 +6401,23 @@ int btrfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
6401 unsigned long zero_start; 6401 unsigned long zero_start;
6402 loff_t size; 6402 loff_t size;
6403 int ret; 6403 int ret;
6404 int reserved = 0;
6404 u64 page_start; 6405 u64 page_start;
6405 u64 page_end; 6406 u64 page_end;
6406 6407
6407 ret = btrfs_delalloc_reserve_space(inode, PAGE_CACHE_SIZE); 6408 ret = btrfs_delalloc_reserve_space(inode, PAGE_CACHE_SIZE);
6408 if (!ret) 6409 if (!ret) {
6409 ret = btrfs_update_time(vma->vm_file); 6410 ret = btrfs_update_time(vma->vm_file);
6411 reserved = 1;
6412 }
6410 if (ret) { 6413 if (ret) {
6411 if (ret == -ENOMEM) 6414 if (ret == -ENOMEM)
6412 ret = VM_FAULT_OOM; 6415 ret = VM_FAULT_OOM;
6413 else /* -ENOSPC, -EIO, etc */ 6416 else /* -ENOSPC, -EIO, etc */
6414 ret = VM_FAULT_SIGBUS; 6417 ret = VM_FAULT_SIGBUS;
6415 goto out; 6418 if (reserved)
6419 goto out;
6420 goto out_noreserve;
6416 } 6421 }
6417 6422
6418 ret = VM_FAULT_NOPAGE; /* make the VM retry the fault */ 6423 ret = VM_FAULT_NOPAGE; /* make the VM retry the fault */
@@ -6495,6 +6500,7 @@ out_unlock:
6495 unlock_page(page); 6500 unlock_page(page);
6496out: 6501out:
6497 btrfs_delalloc_release_space(inode, PAGE_CACHE_SIZE); 6502 btrfs_delalloc_release_space(inode, PAGE_CACHE_SIZE);
6503out_noreserve:
6498 return ret; 6504 return ret;
6499} 6505}
6500 6506