summaryrefslogtreecommitdiff
path: root/fs/btrfs/super.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-04-02 18:53:59 (GMT)
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-04-02 18:53:59 (GMT)
commit7cfcc17e7f2334a0503331264c1340de4e564c85 (patch)
tree4ce6ac8520382673006845ec20b2ad83abc9258a /fs/btrfs/super.c
parent5caf2a002901f0fde475371c4bf1c553b51884af (diff)
downloadlinux-7cfcc17e7f2334a0503331264c1340de4e564c85.tar.xz
Btrfs: corruptions fixed
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r--fs/btrfs/super.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index c260fca..9fd87f5 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -49,6 +49,7 @@ static void btrfs_read_locked_inode(struct inode *inode)
ret = btrfs_lookup_inode(NULL, root, path, inode->i_ino, 0);
if (ret) {
btrfs_release_path(root, path);
+ btrfs_free_path(path);
mutex_unlock(&root->fs_info->fs_mutex);
make_bad_inode(inode);
return;
@@ -215,7 +216,6 @@ static int btrfs_rmdir(struct inode *dir, struct dentry *dentry)
goto out;
}
btrfs_release_path(root, path);
- btrfs_free_path(path);
/* now the directory is empty */
err = btrfs_unlink_trans(trans, root, dir, dentry);
@@ -223,6 +223,8 @@ static int btrfs_rmdir(struct inode *dir, struct dentry *dentry)
inode->i_size = 0;
}
out:
+ btrfs_release_path(root, path);
+ btrfs_free_path(path);
mutex_unlock(&root->fs_info->fs_mutex);
ret = btrfs_end_transaction(trans, root);
if (ret && !err)
@@ -800,11 +802,10 @@ static int btrfs_sync_fs(struct super_block *sb, int wait)
sb->s_dirt = 0;
if (!wait) {
- // filemap_flush(root->fs_info->btree_inode->i_mapping);
- filemap_flush(root->fs_info->sb->s_bdev->bd_inode->i_mapping);
+ filemap_flush(root->fs_info->btree_inode->i_mapping);
return 0;
}
- filemap_write_and_wait(root->fs_info->sb->s_bdev->bd_inode->i_mapping);
+ filemap_write_and_wait(root->fs_info->btree_inode->i_mapping);
mutex_lock(&root->fs_info->fs_mutex);
trans = btrfs_start_transaction(root, 1);
ret = btrfs_commit_transaction(trans, root);