diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index b4129d9072eccb..e7b97c699acf6e 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -1369,7 +1369,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)