aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2/file.c')
-rw-r--r--fs/gfs2/file.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index 7353c0a01a1e..c569adbc1431 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -429,11 +429,11 @@ static int gfs2_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
429 if (ret) 429 if (ret)
430 goto out_unlock; 430 goto out_unlock;
431 431
432 ret = gfs2_quota_lock_check(ip);
433 if (ret)
434 goto out_unlock;
435 gfs2_write_calc_reserv(ip, PAGE_CACHE_SIZE, &data_blocks, &ind_blocks); 432 gfs2_write_calc_reserv(ip, PAGE_CACHE_SIZE, &data_blocks, &ind_blocks);
436 ap.target = data_blocks + ind_blocks; 433 ap.target = data_blocks + ind_blocks;
434 ret = gfs2_quota_lock_check(ip, &ap);
435 if (ret)
436 goto out_unlock;
437 ret = gfs2_inplace_reserve(ip, &ap); 437 ret = gfs2_inplace_reserve(ip, &ap);
438 if (ret) 438 if (ret)
439 goto out_quota_unlock; 439 goto out_quota_unlock;
@@ -827,13 +827,13 @@ static long __gfs2_fallocate(struct file *file, int mode, loff_t offset, loff_t
827 offset += bytes; 827 offset += bytes;
828 continue; 828 continue;
829 } 829 }
830 error = gfs2_quota_lock_check(ip);
831 if (error)
832 return error;
833retry: 830retry:
834 gfs2_write_calc_reserv(ip, bytes, &data_blocks, &ind_blocks); 831 gfs2_write_calc_reserv(ip, bytes, &data_blocks, &ind_blocks);
835
836 ap.target = data_blocks + ind_blocks; 832 ap.target = data_blocks + ind_blocks;
833
834 error = gfs2_quota_lock_check(ip, &ap);
835 if (error)
836 return error;
837 error = gfs2_inplace_reserve(ip, &ap); 837 error = gfs2_inplace_reserve(ip, &ap);
838 if (error) { 838 if (error) {
839 if (error == -ENOSPC && bytes > sdp->sd_sb.sb_bsize) { 839 if (error == -ENOSPC && bytes > sdp->sd_sb.sb_bsize) {
@@ -841,6 +841,7 @@ retry:
841 bytes &= bsize_mask; 841 bytes &= bsize_mask;
842 if (bytes == 0) 842 if (bytes == 0)
843 bytes = sdp->sd_sb.sb_bsize; 843 bytes = sdp->sd_sb.sb_bsize;
844 gfs2_quota_unlock(ip);
844 goto retry; 845 goto retry;
845 } 846 }
846 goto out_qunlock; 847 goto out_qunlock;