Print this page
NEX-5801 Snapshots left over after failed backups
Reviewed by: Rick Mesta <rick.mesta@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Revert "NEX-5801 Snapshots left over after failed backups"
This reverts commit f182fb95f09036db71fbfc6f0a6b90469b761f21.
NEX-5801 Snapshots left over after failed backups
Reviewed by: Rick Mesta <rick.mesta@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
NEX-2911 NDMP logging should use syslog and is too chatty
@@ -35,10 +35,13 @@
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
+/* Copyright 2016 Nexenta Systems, Inc. All rights reserved. */
+
+#include <syslog.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <cstack.h>
@@ -84,21 +87,18 @@
cstack_delete(cstack_t *stk)
{
cstack_t *tmp;
if (stk == NULL) {
- NDMP_LOG(LOG_DEBUG, "cstack_delete: invalid stack");
return;
}
while ((tmp = stk->next) != NULL) {
stk->next = tmp->next;
- NDMP_LOG(LOG_DEBUG, "cstack_delete(element): 0x%p", tmp);
free(tmp);
}
- NDMP_LOG(LOG_DEBUG, "cstack_delete: 0x%p", stk);
free(stk);
}
/*
@@ -115,11 +115,10 @@
cstack_push(cstack_t *stk, void *data, int len)
{
cstack_t *stk_node;
if (stk == NULL) {
- NDMP_LOG(LOG_DEBUG, "cstack_push: invalid stack");
return (-1);
}
if ((stk_node = ndmp_malloc(sizeof (cstack_t))) == NULL)
return (-1);
@@ -127,11 +126,10 @@
stk_node->data = data;
stk_node->len = len;
stk_node->next = stk->next;
stk->next = stk_node;
- NDMP_LOG(LOG_DEBUG, "cstack_push(0x%p): 0x%p", stk, stk_node);
return (0);
}
/*
@@ -146,16 +144,14 @@
cstack_pop(cstack_t *stk, void **data, int *len)
{
cstack_t *stk_node;
if (stk == NULL) {
- NDMP_LOG(LOG_DEBUG, "cstack_pop: invalid stack");
return (-1);
}
if ((stk_node = stk->next) == NULL) {
- NDMP_LOG(LOG_DEBUG, "cstack_pop: underflow");
return (-1);
}
if (data)
*data = stk_node->data;
@@ -162,11 +158,10 @@
if (len)
*len = stk_node->len;
stk->next = stk_node->next;
- NDMP_LOG(LOG_DEBUG, "cstack_pop(0x%p): 0x%p", stk, stk_node);
free(stk_node);
return (0);
}
@@ -179,16 +174,14 @@
*/
int
cstack_top(cstack_t *stk, void **data, int *len)
{
if (stk == NULL) {
- NDMP_LOG(LOG_DEBUG, "cstack_pop: invalid stack");
return (-1);
}
if (stk->next == NULL) {
- NDMP_LOG(LOG_DEBUG, "cstack_pop: underflow");
return (-1);
}
if (data)
*data = stk->next->data;
@@ -542,11 +535,11 @@
return (NULL);
(void) memcpy(&fdip->fd_dir_fh, fhp, sizeof (fs_fhandle_t));
if (!tlm_cat_path(fdip->fd_dir_name, dir, nm)) {
free(fdip);
- NDMP_LOG(LOG_DEBUG, "TAPE BACKUP Find> path too long [%s][%s]",
+ syslog(LOG_DEBUG, "TAPE BACKUP Find> path too long [%s][%s]",
dir, nm);
return (NULL);
}
return (fdip);
}