Mercurial > illumos > illumos-gate
changeset 12942:e50abc8ca9fa
6942852 Format of Hitachi disk does not show progress status
author | Ralph Turner - Sun UK - Contractor <Ralph.Turner@Sun.COM> |
---|---|
date | Wed, 28 Jul 2010 16:37:44 +0100 |
parents | f2051cc42292 |
children | 2acab560865a |
files | usr/src/cmd/format/ctlr_scsi.c |
diffstat | 1 files changed, 19 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/usr/src/cmd/format/ctlr_scsi.c Wed Jul 28 07:22:57 2010 -0700 +++ b/usr/src/cmd/format/ctlr_scsi.c Wed Jul 28 16:37:44 2010 +0100 @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright (c) 1993, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved. */ /* @@ -482,15 +482,30 @@ /* check if format with immed was successfully accepted */ if (status == 0) { - /* immed accepted pool to completion */ + /* immed accepted poll to completion */ status = test_until_ready(cur_file); } else { - /* clear defect header and try basecase format */ + /* clear FOV and try again */ (void) memset((char *)fmt_long_param_header, 0, sizeof (fmt_long_param_header)); fmt_long_param_header[0] = prot_field_usage; + fmt_long_param_header[1] = FDH_IMMED; status = uscsi_cmd(cur_file, &ucmd, - (option_msg && diag_msg) ? F_NORMAL : F_SILENT); + (option_msg && diag_msg) ? F_NORMAL : F_SILENT); + if (status == 0) { + /* immed accepted, poll for progress */ + status = test_until_ready(cur_file); + } else { + /* + * clear defect header and try basecase format + * command will hang until format complete + */ + (void) memset((char *)fmt_long_param_header, 0, + sizeof (fmt_long_param_header)); + fmt_long_param_header[0] = prot_field_usage; + status = uscsi_cmd(cur_file, &ucmd, + (option_msg && diag_msg) ? F_NORMAL : F_SILENT); + } } /* format failure check */