nilfs2: fix missing unlock in error path of nilfs_mdt_write_page
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Sun, 2 Aug 2009 08:45:55 +0000 (17:45 +0900)
committerRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Sun, 2 Aug 2009 13:24:15 +0000 (22:24 +0900)
This adds a missing unlock of nilfs->ns_writer_mutex in
nilfs_mdt_write_page() function.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
fs/nilfs2/mdt.c

index 3d3ddb3f51775301533daf55ff21e331a360ff63..2dfd47714ae5b7329448b107cebd1614989e6e89 100644 (file)
@@ -412,8 +412,10 @@ nilfs_mdt_write_page(struct page *page, struct writeback_control *wbc)
                return 0; /* Do not request flush for shadow page cache */
        if (!sb) {
                writer = nilfs_get_writer(NILFS_MDT(inode)->mi_nilfs);
-               if (!writer)
+               if (!writer) {
+                       nilfs_put_writer(NILFS_MDT(inode)->mi_nilfs);
                        return -EROFS;
+               }
                sb = writer->s_super;
        }