diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 2d23df72e091..10a01dd0c4e6 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -9554,6 +9554,9 @@ static int btrfs_rename_exchange(struct inode *old_dir, goto out_notrans; } + if (dest != root) + btrfs_record_root_in_trans(trans, dest); + /* * We need to find a free sequence number both in the source and * in the destination directory for the exchange.