btrfs-progs: don't start or commit after transaction abort

Signed-off-by: David Sterba <dsterba@suse.com>
master
David Sterba 2017-08-29 14:55:37 +02:00
parent 355a052647
commit 72fbe845d4
1 changed files with 6 additions and 0 deletions

View File

@ -26,6 +26,9 @@ struct btrfs_trans_handle* btrfs_start_transaction(struct btrfs_root *root,
struct btrfs_fs_info *fs_info = root->fs_info;
struct btrfs_trans_handle *h = kzalloc(sizeof(*h), GFP_NOFS);
if (fs_info->transaction_aborted)
return ERR_PTR(-EROFS);
if (!h)
return ERR_PTR(-ENOMEM);
if (root->commit_root) {
@ -141,6 +144,9 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans,
int ret = 0;
struct btrfs_fs_info *fs_info = root->fs_info;
if (trans->fs_info->transaction_aborted)
return -EROFS;
if (root->commit_root == root->node)
goto commit_tree;
if (root == root->fs_info->tree_root)