All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zdenek Kabelac <zkabelac@sourceware.org>
To: lvm-devel@redhat.com
Subject: master - debug: shorten error message
Date: Tue, 20 Oct 2020 20:34:11 +0000 (GMT)	[thread overview]
Message-ID: <20201020203411.688EC385782B@sourceware.org> (raw)

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b75c2dfe1b28efae08be9c7b55e904b8b695a8cd
Commit:        b75c2dfe1b28efae08be9c7b55e904b8b695a8cd
Parent:        b2a326b511950c301fceb7f4901671af53f0e8af
Author:        Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate:    Mon Oct 19 14:28:58 2020 +0200
Committer:     Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Mon Oct 19 16:53:18 2020 +0200

debug: shorten error message

Just check for sigint during log_error().
---
 lib/metadata/lv_manip.c | 26 ++++++++------------------
 1 file changed, 8 insertions(+), 18 deletions(-)

diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 4f59900d1..72c85914d 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -7682,13 +7682,10 @@ int wipe_lv(struct logical_volume *lv, struct wipe_params wp)
 					   TYPE_DM_SNAPSHOT_COW,
 					   wp.yes, wp.force, NULL)) {
 			sigint_restore();
-			if (sigint_caught()) {
-				log_error("Interrupted initialization logical volume %s.",
-					  display_lvname(lv));
-				return 0;
-			}
 			label_scan_invalidate(dev);
-			log_error("Filed to wipe signatures of logical volume %s.",
+			log_error("%s logical volume %s.",
+				  sigint_caught() ?
+				  "Interrupted initialization of" : "Failed to wipe signatures on",
 				  display_lvname(lv));
 			return 0;
 		}
@@ -7733,12 +7730,9 @@ int wipe_lv(struct logical_volume *lv, struct wipe_params wp)
 					log_sys_debug("ioctl", "BLKZEROOUT");
 					sigint_restore();
 					label_scan_invalidate(dev);
-					if (sigint_caught())
-						log_error("Interrupted initialization logical volume %s.",
-							  display_lvname(lv));
-					else
-						log_error("Failed to initialize logical volume %s at position " FMTu64 " and size " FMTu64 ".",
-							  display_lvname(lv), range[0], range[1]);
+					log_error("%s logical volume %s at position " FMTu64 " and size " FMTu64 ".",
+						  sigint_caught() ? "Interrupted initialization of" : "Failed to initialize",
+						  display_lvname(lv), range[0], range[1]);
 					return 0;
 				}
 			}
@@ -7747,12 +7741,8 @@ retry_with_dev_set:
 #endif
 		if (!dev_set_bytes(dev, UINT64_C(0), (size_t) zero_sectors << SECTOR_SHIFT, wp.zero_value)) {
 			sigint_restore();
-			if (sigint_caught()) {
-				log_error("Interrupted initialization logical volume %s.",
-					  display_lvname(lv));
-				return 0;
-			}
-			log_error("Failed to initialize %s of logical volume %s with value %d.",
+			log_error("%s %s of logical volume %s with value %d.",
+				  sigint_caught() ? "Interrupted initialization" : "Failed to initialize",
 				  display_size(lv->vg->cmd, zero_sectors),
 				  display_lvname(lv), wp.zero_value);
 			return 0;



                 reply	other threads:[~2020-10-20 20:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201020203411.688EC385782B@sourceware.org \
    --to=zkabelac@sourceware.org \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.