diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index b4129d9072ec..e7b97c699acf 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -1369,7 +1369,8 @@ next_slot: * 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)