diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 6e9183f587226..b13c212b1bed9 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -9582,6 +9582,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.