qdiskd: clean code around case
Spotted by Coverity Scan
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com> --- :100644 100644 c4db713... 51d9a39... M cman/qdisk/main.c cman/qdisk/main.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/cman/qdisk/main.c b/cman/qdisk/main.c index c4db713..51d9a39 100644 --- a/cman/qdisk/main.c +++ b/cman/qdisk/main.c @@ -146,9 +146,11 @@ check_self(qd_ctx *ctx, status_block_t *sb) case S_EVICT: /* Someone told us to die. */ reboot(RB_AUTOBOOT); + break; default: logt_print(LOG_EMERG, "Unhandled state: %d ", sb->ps_state); raise(SIGSTOP); + break; } } -- 1.7.4.4 |
qdiskd: clean code around case
On 11/23/2011 05:15 AM, Fabio M. Di Nitto wrote:
Spotted by Coverity Scan Signed-off-by: Fabio M. Di Nitto<fdinitto@redhat.com> --- :100644 100644 c4db713... 51d9a39... M cman/qdisk/main.c cman/qdisk/main.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/cman/qdisk/main.c b/cman/qdisk/main.c index c4db713..51d9a39 100644 --- a/cman/qdisk/main.c +++ b/cman/qdisk/main.c @@ -146,9 +146,11 @@ check_self(qd_ctx *ctx, status_block_t *sb) case S_EVICT: /* Someone told us to die. */ reboot(RB_AUTOBOOT); + break; This fallthrough to 'default' was deliberate. default: logt_print(LOG_EMERG, "Unhandled state: %d ", sb->ps_state); raise(SIGSTOP); + break; } } |
qdiskd: clean code around case
On 11/29/2011 06:59 PM, Lon Hohberger wrote:
> On 11/23/2011 05:15 AM, Fabio M. Di Nitto wrote: >> Spotted by Coverity Scan >> >> Signed-off-by: Fabio M. Di Nitto<fdinitto@redhat.com> >> --- >> :100644 100644 c4db713... 51d9a39... M cman/qdisk/main.c >> cman/qdisk/main.c | 2 ++ >> 1 files changed, 2 insertions(+), 0 deletions(-) >> >> diff --git a/cman/qdisk/main.c b/cman/qdisk/main.c >> index c4db713..51d9a39 100644 >> --- a/cman/qdisk/main.c >> +++ b/cman/qdisk/main.c >> @@ -146,9 +146,11 @@ check_self(qd_ctx *ctx, status_block_t *sb) >> case S_EVICT: >> /* Someone told us to die. */ >> reboot(RB_AUTOBOOT); >> + break; > > This fallthrough to 'default' was deliberate. hmm ok, but isn't reboot going to make it useless either way? Fabio |
qdiskd: clean code around case
On 11/29/2011 01:24 PM, Fabio M. Di Nitto wrote:
On 11/29/2011 06:59 PM, Lon Hohberger wrote: On 11/23/2011 05:15 AM, Fabio M. Di Nitto wrote: Spotted by Coverity Scan Signed-off-by: Fabio M. Di Nitto<fdinitto@redhat.com> --- :100644 100644 c4db713... 51d9a39... M cman/qdisk/main.c cman/qdisk/main.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/cman/qdisk/main.c b/cman/qdisk/main.c index c4db713..51d9a39 100644 --- a/cman/qdisk/main.c +++ b/cman/qdisk/main.c @@ -146,9 +146,11 @@ check_self(qd_ctx *ctx, status_block_t *sb) case S_EVICT: /* Someone told us to die. */ reboot(RB_AUTOBOOT); + break; This fallthrough to 'default' was deliberate. hmm ok, but isn't reboot going to make it useless either way? Yes, presuming reboot works. ;) (There are cases where it doesn't; there was a bugzilla open about this when using KVM guests recently ...) SIGSTOP will prevent qdiskd from continuing and casting votes in this case. -- Lon |
| All times are GMT. The time now is 09:30 PM. |
VBulletin, Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.