diff options
author | Josef Bacik <josef@toxicpanda.com> | 2021-03-12 15:25:02 -0500 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2021-04-19 17:25:19 +0200 |
commit | 00aa8e87c9dc63bf145bee00d890198cf7c45a24 (patch) | |
tree | 8e366292bc1c856833dddf3f063693a20135e52d /fs/btrfs | |
parent | 404bccbcaa7ecb073b4d7c1126efda47b346be4a (diff) |
btrfs: handle btrfs_record_root_in_trans failure in btrfs_rename_exchange
btrfs_record_root_in_trans will return errors in the future, so handle
the error properly in btrfs_rename_exchange.
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/inode.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 41517d14c950..179ffb9529d4 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -9108,8 +9108,11 @@ static int btrfs_rename_exchange(struct inode *old_dir, goto out_notrans; } - if (dest != root) - btrfs_record_root_in_trans(trans, dest); + if (dest != root) { + ret = btrfs_record_root_in_trans(trans, dest); + if (ret) + goto out_fail; + } /* * We need to find a free sequence number both in the source and |