diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 1b1a9e35e082..80937c5ca477 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -9616,6 +9616,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.