Another fix for DCO/HPA detection

This commit is contained in:
Christophe Grenier 2010-05-21 09:17:55 +02:00
parent 21d47fea51
commit 76dffac4ca
2 changed files with 5 additions and 4 deletions

View file

@ -37,8 +37,8 @@ int is_hpa_or_dco(const disk_t *disk)
log_warning("%s: Host Protected Area (HPA) present.\n", disk->device);
res=1;
}
if((disk->native_max > 0 && disk->native_max < disk->dco) ||
(disk->user_max > 0 && disk->user_max < disk->dco))
if((disk->native_max > 0 && disk->user_max < disk->native_max+1 && disk->native_max < disk->dco) ||
(disk->user_max > 0 && disk->user_max < disk->dco+1))
{
log_warning("%s: Device Configuration Overlay (DCO) present.\n", disk->device);
res=1;

View file

@ -69,12 +69,13 @@ int interface_check_hidden_ncurses(disk_t *disk)
wmove(stdscr,line++,0);
wprintw(stdscr, "dco %llu sectors\n", (long long unsigned)(disk->dco+1));
}
if(disk->user_max < disk->native_max+1)
if(disk->user_max > 0 && disk->user_max < disk->native_max+1)
{
wmove(stdscr,line++,0);
wprintw(stdscr, "Host Protected Area (HPA) present.\n");
}
if(disk->native_max!=0 && disk->native_max < disk->dco)
if((disk->native_max > 0 && disk->user_max < disk->native_max+1 && disk->native_max < disk->dco) ||
(disk->user_max > 0 && disk->user_max < disk->dco+1))
{
wmove(stdscr,line,0);
wprintw(stdscr, "Device Configuration Overlay (DCO) present.\n");