diff options
author | Bob Peterson <rpeterso@redhat.com> | 2018-01-29 12:00:23 -0500 |
---|---|---|
committer | Bob Peterson <rpeterso@redhat.com> | 2018-01-29 12:00:23 -0500 |
commit | 2eb5909dee9bcce9c0befdef48c00f1132d9de2e (patch) | |
tree | c3345845f88e7b131a9c6d9cc1047cb3f75a53b0 | |
parent | 4519eaad724e868a5fd1f82123eefebcaed775ad (diff) |
GFS2: Don't try to end a non-existent transaction in unlink
Before this patch, if function gfs2_unlink failed to get a valid
transaction (for example, not enough journal blocks) it would go
to label out_end_trans which did gfs2_trans_end. But if the
trans_begin failed, there's no transaction to end, and trying to
do so results in: kernel BUG at fs/gfs2/trans.c:117!
This patch changes the goto so that it does not try to end a
non-existent transaction.
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
-rw-r--r-- | fs/gfs2/inode.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index 20281992d456..59e0560180ec 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c | |||
@@ -1152,12 +1152,11 @@ static int gfs2_unlink(struct inode *dir, struct dentry *dentry) | |||
1152 | 1152 | ||
1153 | error = gfs2_trans_begin(sdp, 2*RES_DINODE + 3*RES_LEAF + RES_RG_BIT, 0); | 1153 | error = gfs2_trans_begin(sdp, 2*RES_DINODE + 3*RES_LEAF + RES_RG_BIT, 0); |
1154 | if (error) | 1154 | if (error) |
1155 | goto out_end_trans; | 1155 | goto out_gunlock; |
1156 | 1156 | ||
1157 | error = gfs2_unlink_inode(dip, dentry); | 1157 | error = gfs2_unlink_inode(dip, dentry); |
1158 | |||
1159 | out_end_trans: | ||
1160 | gfs2_trans_end(sdp); | 1158 | gfs2_trans_end(sdp); |
1159 | |||
1161 | out_gunlock: | 1160 | out_gunlock: |
1162 | gfs2_glock_dq(ghs + 2); | 1161 | gfs2_glock_dq(ghs + 2); |
1163 | out_rgrp: | 1162 | out_rgrp: |