f2fs: put the inode page when error was occurred
authorJaegeuk Kim <jaegeuk@kernel.org>
Tue, 18 Nov 2014 00:14:11 +0000 (16:14 -0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 19 Nov 2014 01:04:33 +0000 (17:04 -0800)
We should put the inode page when error was occurred.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/data.c

index 8f164432408e1a5663d7896df9a2584488348819..12dd58aa569a6218d82be720dc73e847fec956e3 100644 (file)
@@ -963,22 +963,22 @@ repeat:
                } else if (page->index == 0) {
                        err = f2fs_convert_inline_page(&dn, page);
                        if (err)
-                               goto unlock_fail;
+                               goto put_fail;
                } else {
                        struct page *p = grab_cache_page(inode->i_mapping, 0);
                        if (!p) {
                                err = -ENOMEM;
-                               goto unlock_fail;
+                               goto put_fail;
                        }
                        err = f2fs_convert_inline_page(&dn, p);
                        f2fs_put_page(p, 1);
                        if (err)
-                               goto unlock_fail;
+                               goto put_fail;
                }
        }
        err = f2fs_reserve_block(&dn, index);
        if (err)
-               goto unlock_fail;
+               goto put_fail;
 put_next:
        f2fs_put_dnode(&dn);
        f2fs_unlock_op(sbi);
@@ -1021,6 +1021,8 @@ out:
        clear_cold_data(page);
        return 0;
 
+put_fail:
+       f2fs_put_dnode(&dn);
 unlock_fail:
        f2fs_unlock_op(sbi);
        f2fs_put_page(page, 1);