diff mbox series

diskpart: format filesystem only if partition table is changed

Message ID 20210511123214.72088-1-stefano.babic@babic.homelinux.org
State Accepted
Headers show
Series diskpart: format filesystem only if partition table is changed | expand

Commit Message

Stefano Babic May 11, 2021, 12:32 p.m. UTC
From: Stefano Babic <sbabic@denx.de>

Before formatting a filesystem, checks if partition table was changed to
avoid to drop data already stored on the partitions.

Signed-off-by: Stefano Babic <sbabic@denx.de>
---
 handlers/diskpart_handler.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/handlers/diskpart_handler.c b/handlers/diskpart_handler.c
index 65010c1..4258583 100644
--- a/handlers/diskpart_handler.c
+++ b/handlers/diskpart_handler.c
@@ -430,7 +430,7 @@  handler_release:
 
 #ifdef CONFIG_DISKFORMAT
 	/* Create filesystems */
-	if (!ret) {
+	if (!ret && createtable) {
 		LIST_FOREACH(part, &priv.listparts, next) {
 			int index;
 			/*