提交 a867bb28 编写于 作者: S Steven Whitehouse

[GFS2] Fix incorrect error path in prepare_write()

The error path in prepare_write() was incorrect in the (very rare) event
that the transaction fails to start. The following prevents a NULL
pointer dereference,
Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
上级 6eefaf61
......@@ -416,7 +416,7 @@ static int gfs2_prepare_write(struct file *file, struct page *page,
error = gfs2_trans_begin(sdp, rblocks, 0);
if (error)
goto out;
goto out_trans_fail;
if (gfs2_is_stuffed(ip)) {
if (end > sdp->sd_sb.sb_bsize - sizeof(struct gfs2_dinode)) {
......@@ -434,6 +434,7 @@ static int gfs2_prepare_write(struct file *file, struct page *page,
out:
if (error) {
gfs2_trans_end(sdp);
out_trans_fail:
if (alloc_required) {
gfs2_inplace_release(ip);
out_qunlock:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册