From: Jesper Juhl <juhl-lkml@dif.dk>
To: David Teigland <teigland@redhat.com>
Cc: linux-kernel@vger.kernel.org, akpm@osdl.org
Subject: Re: [PATCH 3/7] dlm: recovery
Date: Mon, 25 Apr 2005 20:24:09 +0200 (CEST) [thread overview]
Message-ID: <Pine.LNX.4.62.0504252012120.2941@dragon.hyggekrogen.localhost> (raw)
In-Reply-To: <20050425151239.GD6826@redhat.com>
On Mon, 25 Apr 2005, David Teigland wrote:
>
> When a node is removed from a lockspace, recovery is required for that
> lockspace on all the remaining lockspace members. Recovery involves: a
> full rebuild of the distributed resource directory, selecting a new master
> node for locks/resources previously mastered on the removed node, and
> rebuilding master-copy locks on newly selected masters.
>
> Signed-Off-By: Dave Teigland <teigland@redhat.com>
> Signed-Off-By: Patrick Caulfield <pcaulfie@redhat.com>
>
> ---
[...]
> +static void receive_rcom_status(struct dlm_ls *ls, struct dlm_rcom *rc_in)
> +{
> + struct dlm_rcom *rc;
> + struct dlm_mhandle *mh;
> + int error, nodeid = rc_in->rc_header.h_nodeid;
> +
> + error = create_rcom(ls, nodeid, DLM_RCOM_STATUS_REPLY, 0, &rc, &mh);
> + rc->rc_result = make_status(ls);
> +
> + error = send_rcom(ls, mh, rc);
> +}
This last assignment seems a bit pointless since you never use the value
stored in `error' for anything. Shouldn't you be testing `error' at this
point and take appropriate action? if not, then why bother assigning the
value in the first place. The same comment goes for the assignment a few
lines above. Either use the return value or just kill off the local
variable `error' alltogether and just call create_rcom() and send_rcom()
and throw away the result... I don't know what's appropriate here, but in
any case the current code is a bit silly.
> +static void receive_rcom_names(struct dlm_ls *ls, struct dlm_rcom *rc_in)
> +{
> + struct dlm_rcom *rc;
> + struct dlm_mhandle *mh;
> + int error, inlen, outlen;
[...]
> + error = create_rcom(ls, nodeid, DLM_RCOM_NAMES_REPLY, outlen, &rc, &mh);
> +
> + error = dlm_copy_master_names(ls, rc_in->rc_buf, inlen, rc->rc_buf,
> + outlen, nodeid);
> +
> + error = send_rcom(ls, mh, rc);
> +}
Some more seemingly pointless assignments of values to `error' that are
never used.
> +int dlm_send_rcom_lookup(struct dlm_rsb *r, int dir_nodeid)
> +{
> + struct dlm_rcom *rc;
> + struct dlm_mhandle *mh;
> + struct dlm_ls *ls = r->res_ls;
> + int error;
> +
> + error = create_rcom(ls, dir_nodeid, DLM_RCOM_LOOKUP, r->res_length,
> + &rc, &mh);
> + memcpy(rc->rc_buf, r->res_name, r->res_length);
> + rc->rc_id = (unsigned long) r;
> +
> + error = send_rcom(ls, mh, rc);
> + return 0;
> +}
Again these assignments to a local `error' variable that's never used.
> +static void receive_rcom_lookup(struct dlm_ls *ls, struct dlm_rcom *rc_in)
> +{
> + struct dlm_rcom *rc;
> + struct dlm_mhandle *mh;
> + int error, ret_nodeid, nodeid = rc_in->rc_header.h_nodeid;
> + int len = rc_in->rc_header.h_length - sizeof(struct dlm_rcom);
> +
> + error = dlm_dir_lookup(ls, nodeid, rc_in->rc_buf, len, &ret_nodeid);
> +
> + error = create_rcom(ls, nodeid, DLM_RCOM_LOOKUP_REPLY, 0, &rc, &mh);
> + rc->rc_result = ret_nodeid;
> + rc->rc_id = rc_in->rc_id;
> +
> + error = send_rcom(ls, mh, rc);
> +}
Yet more error assignments that I don't see the point of. There are more
of these, but you can find the rest yourself :)
Don't have time right now to look at more code, so I'll stop here for
now...
--
Jesper Juhl
prev parent reply other threads:[~2005-04-25 18:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-25 15:12 David Teigland
2005-04-25 16:42 ` Nish Aravamudan
2005-04-26 7:27 ` David Teigland
2005-04-26 16:30 ` Nish Aravamudan
2005-04-27 5:23 ` David Teigland
2005-04-25 18:24 ` Jesper Juhl [this message]
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=Pine.LNX.4.62.0504252012120.2941@dragon.hyggekrogen.localhost \
--to=juhl-lkml@dif.dk \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=teigland@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: link
Be 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
all inboxes | Powered by JetHome®