Commit 80990f40 authored by Andreas Gruenbacher's avatar Andreas Gruenbacher Committed by Bob Peterson

gfs2: Clean up trunc_start error path

Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
parent da5eb9cd
...@@ -1022,7 +1022,7 @@ static int trunc_start(struct inode *inode, u64 oldsize, u64 newsize) ...@@ -1022,7 +1022,7 @@ static int trunc_start(struct inode *inode, u64 oldsize, u64 newsize)
struct gfs2_inode *ip = GFS2_I(inode); struct gfs2_inode *ip = GFS2_I(inode);
struct gfs2_sbd *sdp = GFS2_SB(inode); struct gfs2_sbd *sdp = GFS2_SB(inode);
struct address_space *mapping = inode->i_mapping; struct address_space *mapping = inode->i_mapping;
struct buffer_head *dibh; struct buffer_head *dibh = NULL;
int journaled = gfs2_is_jdata(ip); int journaled = gfs2_is_jdata(ip);
int error; int error;
...@@ -1045,7 +1045,7 @@ static int trunc_start(struct inode *inode, u64 oldsize, u64 newsize) ...@@ -1045,7 +1045,7 @@ static int trunc_start(struct inode *inode, u64 oldsize, u64 newsize)
if (newsize & (u64)(sdp->sd_sb.sb_bsize - 1)) { if (newsize & (u64)(sdp->sd_sb.sb_bsize - 1)) {
error = gfs2_block_truncate_page(mapping, newsize); error = gfs2_block_truncate_page(mapping, newsize);
if (error) if (error)
goto out_brelse; goto out;
} }
ip->i_diskflags |= GFS2_DIF_TRUNC_IN_PROG; ip->i_diskflags |= GFS2_DIF_TRUNC_IN_PROG;
} }
...@@ -1059,15 +1059,10 @@ static int trunc_start(struct inode *inode, u64 oldsize, u64 newsize) ...@@ -1059,15 +1059,10 @@ static int trunc_start(struct inode *inode, u64 oldsize, u64 newsize)
else else
truncate_pagecache(inode, newsize); truncate_pagecache(inode, newsize);
if (error) {
brelse(dibh);
return error;
}
out_brelse:
brelse(dibh);
out: out:
gfs2_trans_end(sdp); brelse(dibh);
if (current->journal_info)
gfs2_trans_end(sdp);
return error; return error;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment