Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Cluster Development (http://www.linux-archive.org/cluster-development/)
-   -   qdiskd: clean code around case (http://www.linux-archive.org/cluster-development/601621-qdiskd-clean-code-around-case.html)

"Fabio M. Di Nitto" 11-23-2011 09:15 AM

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

Lon Hohberger 11-29-2011 04:59 PM

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;
}
}

"Fabio M. Di Nitto" 11-29-2011 05:24 PM

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

Lon Hohberger 11-30-2011 08:23 PM

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 06:56 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.