diff --git a/fs/buffer.c b/fs/buffer.c
index f99c509697cd7b11865b6d40f8abda1bd349d7a1..e95fe4f8d11a69eccba7efb818d02f4f0af64288 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -1743,7 +1743,6 @@ static int __block_write_full_page(struct inode *inode, struct page *page,
 	SetPageError(page);
 	BUG_ON(PageWriteback(page));
 	set_page_writeback(page);
-	unlock_page(page);
 	do {
 		struct buffer_head *next = bh->b_this_page;
 		if (buffer_async_write(bh)) {
@@ -1753,6 +1752,7 @@ static int __block_write_full_page(struct inode *inode, struct page *page,
 		}
 		bh = next;
 	} while (bh != head);
+	unlock_page(page);
 	goto done;
 }