Windows, innodb : reduce noise from os_file_get_block_size()

if volume can't be opened due to permissions, or
IOCTL_STORAGE_QUERY_PROPERTY fails with not implemented, do not report it.
Those errors happen, there is nothing user can do.

This patch amends fix for MDEV-12948.
This commit is contained in:
Vladislav Vaintroub 2018-04-14 23:51:23 +01:00
parent 4ea636d5e7
commit 043a9b4e1b

View file

@ -865,8 +865,10 @@ os_file_get_block_size(
0, OPEN_EXISTING, 0, 0);
if (volume_handle == INVALID_HANDLE_VALUE) {
os_file_handle_error_no_exit(volume,
"CreateFile()", FALSE);
if (GetLastError() != ERROR_ACCESS_DENIED) {
os_file_handle_error_no_exit(volume,
"CreateFile()", FALSE);
}
goto end;
}
@ -888,16 +890,7 @@ os_file_get_block_size(
if (!result) {
DWORD err = GetLastError();
if (err == ERROR_INVALID_FUNCTION || err == ERROR_NOT_SUPPORTED) {
// Don't report error, it is driver's fault, not ours or users.
// We handle this with fallback. Report wit info message, just once.
static bool write_info = true;
if (write_info) {
ib::info() << "DeviceIoControl(IOCTL_STORAGE_QUERY_PROPERTY)"
<< " unsupported on volume " << volume;
write_info = false;
}
} else {
if (err != ERROR_INVALID_FUNCTION || err != ERROR_NOT_SUPPORTED) {
os_file_handle_error_no_exit(volume,
"DeviceIoControl(IOCTL_STORAGE_QUERY_PROPERTY)", FALSE);
}