From cd085dc721aa9ddd228fb23ff208df4a2aeb1768 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B6ppner?= Date: Mon, 11 Sep 2017 13:51:02 +0200 Subject: [PATCH] fdasd: Skip partition check with the force option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before writing data to the disk, fdasd always checks whether a partition is specified to prevent writing partition tables to a partition. However, this also prevents the user from writing partition tables to loop devices > loop0, even when the force option is specified. Technically, those are not partitions. Therefore, allow writing partition tables to partitions when the force option is specified. Fixes: #4 Reviewed-by: Stefan Haberland Signed-off-by: Jan Höppner Signed-off-by: Michael Holzheu --- fdasd/fdasd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fdasd/fdasd.c b/fdasd/fdasd.c index 1d24dd52..b50f3926 100644 --- a/fdasd/fdasd.c +++ b/fdasd/fdasd.c @@ -921,7 +921,7 @@ static void fdasd_verify_device(fdasd_anchor_t *anc, char *name) fdasd_error(anc, device_verification_failed, err_str); } - if (minor(dst.st_rdev) & PARTN_MASK) { + if (!anc->force_virtual && minor(dst.st_rdev) & PARTN_MASK) { snprintf(err_str, ERROR_STRING_SIZE, "Partition '%s' (%d/%d) detected where device is " "required\n", name,