mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
dasdfmt: Check disk type before prompting for blocksize
Move check_disk() call before user input to fail fast on unsupported or unavailable devices (FBA, read-only, in-use, raw-track mode). Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com> Signed-off-by: Volkan Unal <vunal@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
@@ -1566,6 +1566,8 @@ int main(int argc, char *argv[])
|
|||||||
g.ese = dasd_sys_ese(g.dev_node);
|
g.ese = dasd_sys_ese(g.dev_node);
|
||||||
eval_format_mode();
|
eval_format_mode();
|
||||||
|
|
||||||
|
check_disk();
|
||||||
|
|
||||||
/* Either let the user specify the blksize or get it from the kernel */
|
/* Either let the user specify the blksize or get it from the kernel */
|
||||||
if (!g.blksize_specified) {
|
if (!g.blksize_specified) {
|
||||||
if (!(mode == FULL ||
|
if (!(mode == FULL ||
|
||||||
@@ -1587,8 +1589,6 @@ int main(int argc, char *argv[])
|
|||||||
error("VOLSER not found on device %s", g.dev_path);
|
error("VOLSER not found on device %s", g.dev_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
check_disk();
|
|
||||||
|
|
||||||
if (check_param(str, ERR_LENGTH, &format_params) < 0)
|
if (check_param(str, ERR_LENGTH, &format_params) < 0)
|
||||||
error("%s", str);
|
error("%s", str);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user