aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/bmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2/bmap.c')
-rw-r--r--fs/gfs2/bmap.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c
index 3a5d3f883e10..329763530dc0 100644
--- a/fs/gfs2/bmap.c
+++ b/fs/gfs2/bmap.c
@@ -25,7 +25,6 @@
25#include "trans.h" 25#include "trans.h"
26#include "dir.h" 26#include "dir.h"
27#include "util.h" 27#include "util.h"
28#include "ops_address.h"
29 28
30/* This doesn't need to be that large as max 64 bit pointers in a 4k 29/* This doesn't need to be that large as max 64 bit pointers in a 4k
31 * block is 512, so __u16 is fine for that. It saves stack space to 30 * block is 512, so __u16 is fine for that. It saves stack space to
@@ -136,7 +135,9 @@ int gfs2_unstuff_dinode(struct gfs2_inode *ip, struct page *page)
136 and write it out to disk */ 135 and write it out to disk */
137 136
138 unsigned int n = 1; 137 unsigned int n = 1;
139 block = gfs2_alloc_block(ip, &n); 138 error = gfs2_alloc_block(ip, &block, &n);
139 if (error)
140 goto out_brelse;
140 if (isdir) { 141 if (isdir) {
141 gfs2_trans_add_unrevoke(GFS2_SB(&ip->i_inode), block, 1); 142 gfs2_trans_add_unrevoke(GFS2_SB(&ip->i_inode), block, 1);
142 error = gfs2_dir_get_new_buffer(ip, block, &bh); 143 error = gfs2_dir_get_new_buffer(ip, block, &bh);
@@ -476,8 +477,11 @@ static int gfs2_bmap_alloc(struct inode *inode, const sector_t lblock,
476 blks = dblks + iblks; 477 blks = dblks + iblks;
477 i = sheight; 478 i = sheight;
478 do { 479 do {
480 int error;
479 n = blks - alloced; 481 n = blks - alloced;
480 bn = gfs2_alloc_block(ip, &n); 482 error = gfs2_alloc_block(ip, &bn, &n);
483 if (error)
484 return error;
481 alloced += n; 485 alloced += n;
482 if (state != ALLOC_DATA || gfs2_is_jdata(ip)) 486 if (state != ALLOC_DATA || gfs2_is_jdata(ip))
483 gfs2_trans_add_unrevoke(sdp, bn, n); 487 gfs2_trans_add_unrevoke(sdp, bn, n);
@@ -1008,7 +1012,7 @@ static int gfs2_block_truncate_page(struct address_space *mapping)
1008 gfs2_trans_add_bh(ip->i_gl, bh, 0); 1012 gfs2_trans_add_bh(ip->i_gl, bh, 0);
1009 1013
1010 zero_user(page, offset, length); 1014 zero_user(page, offset, length);
1011 1015 mark_buffer_dirty(bh);
1012unlock: 1016unlock:
1013 unlock_page(page); 1017 unlock_page(page);
1014 page_cache_release(page); 1018 page_cache_release(page);