diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2007-02-07 10:25:59 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2007-02-07 10:25:59 -0500 |
commit | 2d72e7101cc7fff5c1eb21bfcbba51c8002418d2 (patch) | |
tree | 4f67388942d5716fb18732c04b8a8d74bdff0ff8 /fs | |
parent | 549ae0ac3d574a682e82b02e79259a65445a675b (diff) |
[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: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/gfs2/ops_address.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/gfs2/ops_address.c b/fs/gfs2/ops_address.c index 9ddf9753a552..5e9653c4d886 100644 --- a/fs/gfs2/ops_address.c +++ b/fs/gfs2/ops_address.c | |||
@@ -360,8 +360,10 @@ static int gfs2_prepare_write(struct file *file, struct page *page, | |||
360 | gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, GL_ATIME|LM_FLAG_TRY_1CB, &ip->i_gh); | 360 | gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, GL_ATIME|LM_FLAG_TRY_1CB, &ip->i_gh); |
361 | error = gfs2_glock_nq_atime(&ip->i_gh); | 361 | error = gfs2_glock_nq_atime(&ip->i_gh); |
362 | if (unlikely(error)) { | 362 | if (unlikely(error)) { |
363 | if (error == GLR_TRYFAILED) | 363 | if (error == GLR_TRYFAILED) { |
364 | unlock_page(page); | ||
364 | error = AOP_TRUNCATED_PAGE; | 365 | error = AOP_TRUNCATED_PAGE; |
366 | } | ||
365 | goto out_uninit; | 367 | goto out_uninit; |
366 | } | 368 | } |
367 | 369 | ||