Josef Bacik
2012-May-31 15:08 UTC
[PATCH] Btrfs: check the return code of btrfs_save_ino_cache
In doing my enospc work I would sometimes error out in btrfs_save_ino_cache which would abort the transaction but we''d still end up with a corrupted file system. This is because we don''t actually check the return value and so if somethign goes wrong we just exit out and screw everything up. This fixes this particular part. Thanks, Btrfs: check the return code of btrfs_save_ino_cache In doing my enospc work I would sometimes error out in btrfs_save_ino_cache which would abort the transaction but we''d still end up with a corrupted file system. This is because we don''t actually check the return value and so if somethign goes wrong we just exit out and screw everything up. This fixes this particular part. Thanks, Signed-off-by: Josef Bacik <josef@redhat.com> --- fs/btrfs/transaction.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 82b03af..7aed0e8 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -823,7 +823,9 @@ static noinline int commit_fs_roots(struct btrfs_trans_handle *trans, btrfs_update_reloc_root(trans, root); btrfs_orphan_commit_root(trans, root); - btrfs_save_ino_cache(root, trans); + err = btrfs_save_ino_cache(root, trans); + if (err) + goto out; /* see comments in should_cow_block() */ root->force_cow = 0; @@ -848,6 +850,7 @@ static noinline int commit_fs_roots(struct btrfs_trans_handle *trans, } } spin_unlock(&fs_info->fs_roots_radix_lock); +out: return err; } -- 1.7.7.6 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html