Skip to content

Commit

Permalink
GFS2: Adding missing unlock_page()
Browse files Browse the repository at this point in the history
gfs2_write_begin() calls grab_cache_page_write_begin() that returns *locked*
page. Correspondent error-handling path lacks for unlock_page() call:

> out:
> 	if (error == 0)
> 		return 0;
>
> 	page_cache_release(page);

The whole system hangs if gfs2_unstuff_dinode() called from gfs2_write_begin()
failed for some reason.

Reported-by: Maxim <maxim.patlasov@gmail.com>
Signed-off-by: Maxim <maxim.patlasov@gmail.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
  • Loading branch information
Maxim authored and Steven Whitehouse committed Mar 14, 2011
1 parent c618e87 commit 6c474f7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/gfs2/aops.c
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,7 @@ static int gfs2_write_begin(struct file *file, struct address_space *mapping,
if (error == 0)
return 0;

unlock_page(page);
page_cache_release(page);

gfs2_trans_end(sdp);
Expand Down

0 comments on commit 6c474f7

Please sign in to comment.