diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c index 6c6a6f9f8..1afd8fbb4 100644 --- a/grub-core/fs/btrfs.c +++ b/grub-core/fs/btrfs.c @@ -726,9 +726,11 @@ find_path (struct grub_btrfs_data *data, break; } case GRUB_BTRFS_ITEM_TYPE_INODE_ITEM: - if (*slash) + if (*slash && *type == GRUB_BTRFS_DIR_ITEM_TYPE_REGULAR) return grub_error (GRUB_ERR_FILE_NOT_FOUND, "file not found"); *key = cdirel->key; + if (*type == GRUB_BTRFS_DIR_ITEM_TYPE_DIRECTORY) + key->type = GRUB_BTRFS_ITEM_TYPE_DIR_ITEM; break; default: return grub_error (GRUB_ERR_BAD_FS, "unrecognised object type 0x%x",