From: Zdenek Kabelac Date: Wed, 1 Dec 2010 12:56:39 +0000 (+0000) Subject: Add backtraces for errors X-Git-Tag: v2_02_91~1309 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=166597d9984f8ae3aa7115fc673a1936774280c2;p=lvm2.git Add backtraces for errors Add stack; backtraces when error is reported from dev_set() or dev_close_immediate(). --- diff --git a/WHATS_NEW b/WHATS_NEW index 5528b0569..c86e86134 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.78 - ==================================== + Add backtraces for dev_set() and dev_close_immediate() errors in set_lv(). Add logging for unlink() error in clvmd remove_lockfile(). Add logging for pipe write() and close() error in clvmd child_init_signal(). Add test for existance of orphan vginfo in _lvmcache_update_vgname(). diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index 31f1ff327..6f553cd6f 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -3033,9 +3033,13 @@ int set_lv(struct cmd_context *cmd, struct logical_volume *lv, if (sectors > lv->size) sectors = lv->size; - dev_set(dev, UINT64_C(0), (size_t) sectors << SECTOR_SHIFT, value); + if (!dev_set(dev, UINT64_C(0), (size_t) sectors << SECTOR_SHIFT, value)) + stack; + dev_flush(dev); - dev_close_immediate(dev); + + if (!dev_close_immediate(dev)) + stack; return 1; }