From 94df75cdeb58795069ffa1c0b8bcb9e3618fbf74 Mon Sep 17 00:00:00 2001 From: Michal Mielewczyk Date: Tue, 11 Jun 2019 04:57:44 -0400 Subject: [PATCH 1/4] Close ctrl device in error path --- casadm/statistics_model.c | 1 + 1 file changed, 1 insertion(+) diff --git a/casadm/statistics_model.c b/casadm/statistics_model.c index b98a9eb..9cb03e1 100644 --- a/casadm/statistics_model.c +++ b/casadm/statistics_model.c @@ -1171,6 +1171,7 @@ int cache_status(unsigned int cache_id, unsigned int core_id, int io_class_id, if (create_pipe_pair(intermediate_file)) { cas_printf(LOG_ERR,"Failed to create unidirectional pipe.\n"); + close(ctrl_fd); return FAILURE; } From 6911cc782be6f12fd2aebc701fc8d0bde3f826d5 Mon Sep 17 00:00:00 2001 From: Michal Mielewczyk Date: Wed, 12 Jun 2019 06:34:07 -0400 Subject: [PATCH 2/4] Removed reduntant variable --- casadm/statistics_model.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/casadm/statistics_model.c b/casadm/statistics_model.c index 9cb03e1..8d24443 100644 --- a/casadm/statistics_model.c +++ b/casadm/statistics_model.c @@ -1175,13 +1175,6 @@ int cache_status(unsigned int cache_id, unsigned int core_id, int io_class_id, return FAILURE; } - /* Select file to which statistics shall be printed and - * - */ - FILE *outfile; - - outfile = stdout; - /** * printing in statistics will be performed in separate * thread, so that we can interleave statistics collecting @@ -1189,7 +1182,7 @@ int cache_status(unsigned int cache_id, unsigned int core_id, int io_class_id, */ struct stats_printout_ctx printout_ctx; printout_ctx.intermediate = intermediate_file[0]; - printout_ctx.out = outfile; + printout_ctx.out = stdout; printout_ctx.type = (OUTPUT_FORMAT_CSV == output_format ? CSV : TEXT); pthread_t thread; pthread_create(&thread, 0, stats_printout, &printout_ctx); @@ -1302,8 +1295,5 @@ cleanup: fclose(intermediate_file[0]); - if (outfile != stdout) { - fclose(outfile); - } return ret; } From 66a2d3ddd46e2523fc55247455c15297a4e757c4 Mon Sep 17 00:00:00 2001 From: Michal Mielewczyk Date: Tue, 11 Jun 2019 05:43:34 -0400 Subject: [PATCH 3/4] Fixed classifier debug message --- modules/cas_cache/classifier.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/cas_cache/classifier.c b/modules/cas_cache/classifier.c index 9dd658e..00dd008 100644 --- a/modules/cas_cache/classifier.c +++ b/modules/cas_cache/classifier.c @@ -694,7 +694,7 @@ void cas_cls_rule_apply(ocf_cache_t cache, if (old) CAS_CLS_DEBUG_MSG("Removed rule for class %d\n", part_id); if (new) - CAS_CLS_DEBUG_MSG("New rule for for class %d\n", part_id); + CAS_CLS_DEBUG_MSG("New rule for class %d\n", part_id); return; } From d6c5fdf5a2b7b2a890f5200428cc2ead3d302922 Mon Sep 17 00:00:00 2001 From: Michal Mielewczyk Date: Tue, 11 Jun 2019 07:31:56 -0400 Subject: [PATCH 4/4] Remove redundant assertion --- casadm/table.c | 1 - 1 file changed, 1 deletion(-) diff --git a/casadm/table.c b/casadm/table.c index 1f28dbe..44502cd 100644 --- a/casadm/table.c +++ b/casadm/table.c @@ -95,7 +95,6 @@ char *table_get(struct table *t,int y, int x) static const char * empty=""; if (y >= t->height || x >= t->width) { assert(0); - abort(); return (char*)empty; }