diff options
author | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-05-19 21:26:09 -0400 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-05-28 02:03:03 -0400 |
commit | 45856aff0d9091f4836e333951c66eca382a8573 (patch) | |
tree | e35d4b4a4b65f3d9453858ffde9602d9dc64791a /fs/f2fs | |
parent | 9a55ed656c9afbe41316ab2373bc063359b7683f (diff) |
f2fs: fix to unlock page before exit
If we got an error after lock_page, we should unlock it before exit.
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs')
-rw-r--r-- | fs/f2fs/recovery.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c index f91ff0f0044d..3a4b51c03321 100644 --- a/fs/f2fs/recovery.c +++ b/fs/f2fs/recovery.c | |||
@@ -347,7 +347,7 @@ static int recover_data(struct f2fs_sb_info *sbi, | |||
347 | lock_page(page); | 347 | lock_page(page); |
348 | 348 | ||
349 | if (cp_ver != cpver_of_node(page)) | 349 | if (cp_ver != cpver_of_node(page)) |
350 | goto unlock_out; | 350 | break; |
351 | 351 | ||
352 | entry = get_fsync_inode(head, ino_of_node(page)); | 352 | entry = get_fsync_inode(head, ino_of_node(page)); |
353 | if (!entry) | 353 | if (!entry) |
@@ -355,7 +355,7 @@ static int recover_data(struct f2fs_sb_info *sbi, | |||
355 | 355 | ||
356 | err = do_recover_data(sbi, entry->inode, page, blkaddr); | 356 | err = do_recover_data(sbi, entry->inode, page, blkaddr); |
357 | if (err) | 357 | if (err) |
358 | goto out; | 358 | break; |
359 | 359 | ||
360 | if (entry->blkaddr == blkaddr) { | 360 | if (entry->blkaddr == blkaddr) { |
361 | iput(entry->inode); | 361 | iput(entry->inode); |
@@ -366,7 +366,6 @@ next: | |||
366 | /* check next segment */ | 366 | /* check next segment */ |
367 | blkaddr = next_blkaddr_of_node(page); | 367 | blkaddr = next_blkaddr_of_node(page); |
368 | } | 368 | } |
369 | unlock_out: | ||
370 | unlock_page(page); | 369 | unlock_page(page); |
371 | out: | 370 | out: |
372 | __free_pages(page, 0); | 371 | __free_pages(page, 0); |