Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2d72e710 authored by Steven Whitehouse's avatar Steven Whitehouse
Browse files

[GFS2] Unlock page on prepare_write try lock failure



When the try lock of the glock failed in prepare_write we were
incorrectly exiting this function with the page still locked.
This was resulting in further I/O to this page hanging.

Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
parent 549ae0ac
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -360,8 +360,10 @@ static int gfs2_prepare_write(struct file *file, struct page *page,
	gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, GL_ATIME|LM_FLAG_TRY_1CB, &ip->i_gh);
	gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, GL_ATIME|LM_FLAG_TRY_1CB, &ip->i_gh);
	error = gfs2_glock_nq_atime(&ip->i_gh);
	error = gfs2_glock_nq_atime(&ip->i_gh);
	if (unlikely(error)) {
	if (unlikely(error)) {
		if (error == GLR_TRYFAILED)
		if (error == GLR_TRYFAILED) {
			unlock_page(page);
			error = AOP_TRUNCATED_PAGE;
			error = AOP_TRUNCATED_PAGE;
		}
		goto out_uninit;
		goto out_uninit;
	}
	}