Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-24175

Windows - fix detection of whether file is on SSD

    XMLWordPrintable

Details

    Description

      As pointed in https://devblogs.microsoft.com/oldnewthing/20201023-00/?p=104395, correct detection of SSD for a file with given name is more tedious than we're doing it.

      What we're doing

      • Find volume path
      • Open volume as file (we construct volume name by prefixing volume path with \\?\, and remove the trailing colon
      • Use DeviceIoControl to find out whether there is a seek penalty

      This works in some cases, but in some cases, it does not. It does not work for volumes that have mount point which is not drive letter. And it does not work for volumes that consist of multiple physical disk (DeviceIoControl does a shortcut, it will forward request to the physical disk, if volume has a single disk, but return error otherwise)

      What we should be doing instead

      • Find volume path
      • Find volume name GetVolumeNameForVolumeMountPoint(), this gives \\?\Volume {GUID}

        name

      • open volume using that name
      • Enumerate all volume physical disks, and find out whether every physical disk is on SSD

      Attachments

        Activity

          People

            wlad Vladislav Vaintroub
            wlad Vladislav Vaintroub
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.