diff --git a/fs/btrfs/reflink.c b/fs/btrfs/reflink.c index c4f87df5328337..eeb66e797e0bf8 100644 --- a/fs/btrfs/reflink.c +++ b/fs/btrfs/reflink.c @@ -281,6 +281,11 @@ static int clone_copy_inline_extent(struct inode *dst, ret = btrfs_inode_set_file_extent_range(BTRFS_I(dst), 0, aligned_end); out: if (!ret && !trans) { + /* + * Release path before starting a new transaction so we don't + * hold locks that would confuse lockdep. + */ + btrfs_release_path(path); /* * No transaction here means we copied the inline extent into a * page of the destination inode.