diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 9ea4c6f0352f06..08fa1a0a639728 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -1372,7 +1372,8 @@ static noinline int run_delalloc_nocow(struct inode *inode, * Do the same check as in btrfs_cross_ref_exist but * without the unnecessary search. */ - if (btrfs_file_extent_generation(leaf, fi) <= + if (!nolock && + btrfs_file_extent_generation(leaf, fi) <= btrfs_root_last_snapshot(&root->root_item)) goto out_check; if (extent_type == BTRFS_FILE_EXTENT_REG && !force)