All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jes Sorensen <Jes.Sorensen@redhat.com>
To: gqjiang@suse.com
Cc: linux-raid <linux-raid@vger.kernel.org>,
	NeilBrown <neilb@suse.de>, Goldwyn Rodrigues <rgoldwyn@suse.com>
Subject: dead code question
Date: Fri, 04 Mar 2016 16:27:33 -0500	[thread overview]
Message-ID: <wrfjpovaylve.fsf@redhat.com> (raw)

Hi,

Another question regarding the cluster code. This one was introduced
with:

commit d15a1f72bd92bc4724ee94b2ae8132633ffeb72b
Author: Guoqing Jiang <gqjiang@suse.com>
Date:   Mon Oct 19 16:03:19 2015 +0800

    Safeguard against writing to an active device of another node
    
    Modifying an exiting device's superblock or creating a new superblock
    on an existing device needs to be checked because the device could be
    in use by another node in another array. So, we check this by taking
    all superblock locks in userspace so that we don't  step onto an active
    device used by another node and safeguard against accidental edits.
    After the edit is complete, we release all locks and the lockspace so
    that it can be used by the kernel space.
    
    Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
    Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
    Signed-off-by: NeilBrown <neilb@suse.com>

[snip]

+/* Create the lockspace, take bitmapXXX locks on all the bitmaps. */
+int cluster_get_dlmlock(struct supertype *st, int *lockid)
+{
+       int ret = -1;
+       char str[64];
+       int flags = LKF_NOQUEUE;
+
+       dlm_lock_res = xmalloc(sizeof(struct dlm_lock_resource));
+       dlm_lock_res->ls = dlm_hooks->create_lockspace(st->cluster_name, O_RDWR);
+       if (!dlm_lock_res->ls) {
+               pr_err("%s failed to create lockspace\n", st->cluster_name);
+                goto out;
+       }
+
+       /* Conversions need the lockid in the LKSB */
+       if (flags & LKF_CONVERT)
+               dlm_lock_res->lksb.sb_lkid = *lockid;

You set flags = LKF_NOQUEUE but later check (flags & LKF_CONVERT), which
cannot be true given that:

mdadm.h:#define LKF_NOQUEUE	0x00000001
mdadm.h:#define LKF_CONVERT	0x00000004

Is this a bug, or do you have pending patches for this?

Cheers,
Jes

             reply	other threads:[~2016-03-04 21:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-04 21:27 Jes Sorensen [this message]
2016-03-07 13:18 ` dead code question Guoqing Jiang

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=wrfjpovaylve.fsf@redhat.com \
    --to=jes.sorensen@redhat.com \
    --cc=gqjiang@suse.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=rgoldwyn@suse.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.