From: Steven Whitehouse <swhiteho@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 5/5] gfs2: dlm based recovery coordination
Date: Thu, 05 Jan 2012 16:58:22 +0000 [thread overview]
Message-ID: <1325782702.2690.47.camel@menhir> (raw)
In-Reply-To: <1325782010-8060-6-git-send-email-teigland@redhat.com>
Hi,
On Thu, 2012-01-05 at 10:46 -0600, David Teigland wrote:
[snip]
>
> +static int gdlm_mount(struct gfs2_sbd *sdp, const char *table)
> +{
> + struct lm_lockstruct *ls = &sdp->sd_lockstruct;
> + char cluster[GFS2_LOCKNAME_LEN];
> + const char *fsname;
> + uint32_t flags;
> + int error, ops_result;
> +
> + /*
> + * initialize everything
> + */
> +
> + INIT_DELAYED_WORK(&sdp->sd_control_work, gfs2_control_func);
> + spin_lock_init(&ls->ls_recover_spin);
> + ls->ls_recover_flags = 0;
> + ls->ls_recover_mount = 0;
> + ls->ls_recover_start = 0;
> + ls->ls_recover_block = 0;
> + ls->ls_recover_size = 0;
> + ls->ls_recover_submit = NULL;
> + ls->ls_recover_result = NULL;
> +
> + error = set_recover_size(sdp, NULL, 0);
> + if (error)
> + goto fail;
> +
> + /*
> + * prepare dlm_new_lockspace args
> + */
> +
> + fsname = strchr(table, ':');
> + if (!fsname) {
> + fs_info(sdp, "no fsname found\n");
> + error = -EINVAL;
> + goto fail_free;
> + }
> + memset(cluster, 0, sizeof(cluster));
> + memcpy(cluster, table, strlen(table) - strlen(fsname));
> + fsname++;
> +
> + flags = DLM_LSFL_FS | DLM_LSFL_NEWEXCL;
> + if (ls->ls_nodir)
> + flags |= DLM_LSFL_NODIR;
> +
> + /*
> + * create/join lockspace
> + */
> +
> + error = dlm_new_lockspace(fsname, cluster, flags, GDLM_LVB_SIZE,
> + &gdlm_lockspace_ops, sdp, &ops_result,
> + &ls->ls_dlm);
> + if (error) {
> + fs_err(sdp, "dlm_new_lockspace error %d\n", error);
> + goto fail_free;
> + }
> +
> + if (ops_result < 0) {
> + /*
> + * dlm does not support ops callbacks,
> + * old dlm_controld/gfs_controld are used, try without ops.
> + */
> + fs_info(sdp, "dlm lockspace ops not used\n");
> + free_recover_size(ls);
> + set_bit(DFL_NO_DLM_OPS, &ls->ls_recover_flags);
> + return 0;
> + }
> +
> + if (!test_bit(SDF_NOJOURNALID, &sdp->sd_flags)) {
> + fs_err(sdp, "dlm lockspace ops disallow jid preset\n");
> + error = -EINVAL;
> + goto fail_release;
> + }
> +
> + /*
> + * control_mount() uses control_lock to determine first mounter,
> + * and for later mounts, waits for any recoveries to be cleared.
> + */
> +
> + error = control_mount(sdp);
> + if (error) {
> + fs_err(sdp, "mount control error %d\n", error);
> + goto fail_release;
> + }
> +
> + clear_bit(SDF_NOJOURNALID, &sdp->sd_flags);
> + smp_mb__after_clear_bit();
> + wake_up_bit(&sdp->sd_flags, SDF_NOJOURNALID);
> + ls->ls_first = !!test_bit(DFL_FIRST_MOUNT, &ls->ls_recover_flags);
> + return 0;
> +
This bit of code, which was correct last time you posted this patch
appears to have reverted to its previous incorrect state. ls_first must
be set before SDF_NOJOURNALID is cleared, otherwise the uninitialised
value may be read,
Steve.
next prev parent reply other threads:[~2012-01-05 16:58 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-05 16:46 [Cluster-devel] [PATCH 5/5] gfs2: dlm based recovery coordination David Teigland
2012-01-05 16:58 ` Steven Whitehouse [this message]
2012-01-05 17:13 ` David Teigland
2012-01-09 16:36 ` Steven Whitehouse
2012-01-09 16:46 ` David Teigland
2012-01-09 17:00 ` David Teigland
2012-01-09 17:04 ` Steven Whitehouse
2012-01-09 17:02 ` Steven Whitehouse
-- strict thread matches above, loose matches on Subject: below --
2011-12-16 22:03 David Teigland
2011-12-19 13:07 ` Steven Whitehouse
2011-12-19 17:47 ` David Teigland
2011-12-20 10:39 ` Steven Whitehouse
2011-12-20 19:16 ` David Teigland
2011-12-20 21:04 ` David Teigland
2011-12-21 10:45 ` Steven Whitehouse
2011-12-21 15:40 ` David Teigland
2011-12-22 21:23 ` David Teigland
2011-12-23 9:19 ` Steven Whitehouse
2011-12-19 15:17 ` Steven Whitehouse
2012-01-05 15:08 ` Bob Peterson
2012-01-05 15:21 ` David Teigland
2012-01-05 15:40 ` Steven Whitehouse
2012-01-05 16:16 ` David Teigland
2012-01-05 16:45 ` Bob Peterson
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=1325782702.2690.47.camel@menhir \
--to=swhiteho@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;
as well as URLs for NNTP newsgroup(s).