public inbox for cluster-cvs@sourceware.org help / color / mirror / Atom feed
From: David Teigland <teigland@fedoraproject.org> To: cluster-cvs-relay@redhat.com Subject: cluster: STABLE3 - dlm_controld/gfs_controld: handle zero global_id (in compat code) Date: Mon, 27 Apr 2009 19:56:00 -0000 [thread overview] Message-ID: <20090427195614.1DBFC1202D2@lists.fedorahosted.org> (raw) Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=85e44738ea85fd36d0af5ff257afff051d5e4460 Commit: 85e44738ea85fd36d0af5ff257afff051d5e4460 Parent: 6384601982d87ecc756876af334abde86f952ff7 Author: David Teigland <teigland@redhat.com> AuthorDate: Mon Apr 27 14:18:00 2009 -0500 Committer: David Teigland <teigland@redhat.com> CommitterDate: Mon Apr 27 14:18:00 2009 -0500 dlm_controld/gfs_controld: handle zero global_id (in compat code) bz 493207 groupd can sometimes assign global_id of 0. dlm_controld and gfs_controld now replace 0 id's from groupd with a hash of the group name. Signed-off-by: David Teigland <teigland@redhat.com> --- group/dlm_controld/cpg.c | 2 -- group/dlm_controld/dlm_daemon.h | 5 +++-- group/dlm_controld/group.c | 12 ++++++++++++ group/gfs_controld/gfs_daemon.h | 4 +++- group/gfs_controld/group.c | 12 ++++++++++++ 5 files changed, 30 insertions(+), 5 deletions(-) diff --git a/group/dlm_controld/cpg.c b/group/dlm_controld/cpg.c index 43b36fd..4fb81c8 100644 --- a/group/dlm_controld/cpg.c +++ b/group/dlm_controld/cpg.c @@ -1,8 +1,6 @@ #include "dlm_daemon.h" #include "config.h" -uint32_t cpgname_to_crc(const char *data, int len); - struct protocol_version { uint16_t major; uint16_t minor; diff --git a/group/dlm_controld/dlm_daemon.h b/group/dlm_controld/dlm_daemon.h index 8933db7..1f49800 100644 --- a/group/dlm_controld/dlm_daemon.h +++ b/group/dlm_controld/dlm_daemon.h @@ -261,7 +261,6 @@ void deadlk_confchg(struct lockspace *ls, const struct cpg_address *left_list, int left_list_entries, const struct cpg_address *joined_list, int joined_list_entries); - /* main.c */ int do_read(int fd, void *buf, size_t count); int do_write(int fd, void *buf, size_t count); @@ -341,10 +340,12 @@ int inline void set_group_mode(void) { return 0; } #endif /* logging.c */ - void init_logging(void); void setup_logging(); void close_logging(void); +/* crc.c */ +uint32_t cpgname_to_crc(const char *data, int len); + #endif diff --git a/group/dlm_controld/group.c b/group/dlm_controld/group.c index 9b863b7..a5e2898 100644 --- a/group/dlm_controld/group.c +++ b/group/dlm_controld/group.c @@ -97,6 +97,16 @@ static char *str_members(void) return str_members_buf; } +static unsigned int replace_zero_global_id(char *name) +{ + unsigned int new_id; + + new_id = cpgname_to_crc(name, strlen(name)); + + log_error("replace zero id for %s with %u", name, new_id); + return new_id; +} + void process_groupd(int ci) { struct lockspace *ls; @@ -158,6 +168,8 @@ void process_groupd(int ci) case DO_SETID: log_debug("groupd callback: set_id %s %x", cb_name, cb_id); + if (!cb_id) + cb_id = replace_zero_global_id(cb_name); set_sysfs_id(cb_name, cb_id); ls->global_id = cb_id; break; diff --git a/group/gfs_controld/gfs_daemon.h b/group/gfs_controld/gfs_daemon.h index cf56d19..4063148 100644 --- a/group/gfs_controld/gfs_daemon.h +++ b/group/gfs_controld/gfs_daemon.h @@ -325,9 +325,11 @@ void update_flow_control_status(void); int check_uncontrolled_filesystems(void); /* logging.c */ - void init_logging(void); void setup_logging(); void close_logging(void); +/* crc.c */ +uint32_t cpgname_to_crc(const char *data, int len); + #endif diff --git a/group/gfs_controld/group.c b/group/gfs_controld/group.c index e5046b2..599015c 100644 --- a/group/gfs_controld/group.c +++ b/group/gfs_controld/group.c @@ -93,6 +93,16 @@ static char *str_members(void) return str_members_buf; } +static unsigned int replace_zero_global_id(char *name) +{ + unsigned int new_id; + + new_id = cpgname_to_crc(name, strlen(name)); + + log_error("replace zero id for %s with %u", name, new_id); + return new_id; +} + void process_groupd(int ci) { struct mountgroup *mg; @@ -145,6 +155,8 @@ void process_groupd(int ci) case DO_SETID: log_debug("groupd cb: set_id %s %x", cb_name, cb_id); + if (!cb_id) + cb_id = replace_zero_global_id(cb_name); mg->id = cb_id; break;
reply other threads:[~2009-04-27 19:56 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20090427195614.1DBFC1202D2@lists.fedorahosted.org \ --to=teigland@fedoraproject.org \ --cc=cluster-cvs-relay@redhat.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).