All of lore.kernel.org
 help / color / mirror / Atom feed
From: J. Bruce Fields <bfields@fieldses.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH] gfs2: fix lock cancelling
Date: Thu, 20 Sep 2007 11:48:23 -0400	[thread overview]
Message-ID: <20070920154823.GB19232@fieldses.org> (raw)
In-Reply-To: <20070920153153.GB22130@redhat.com>

On Thu, Sep 20, 2007 at 10:31:54AM -0500, David Teigland wrote:
> If found on the recv_list, it means the op has been sent up to the lock
> manager in userspace and is still floating around up there.  If we remove
> the op from the recv_list, it means, as you say, that the lock manager
> could get an error back later when it does dev_write() to complete the op.
> (dev_write() just prints an error message currently, doesn't return an
> error to userspace.)
> 
> This assumes, of course, that seeing an error, the lock manager could do
> something sensible to bring itself back in sync with the application... as
> we've discussed before, that's a hard problem that we may never solve :-)

It's a hard problem, but it'll need to be solved some day.  And it can't
be solved as long as the kernel isn't even giving userspace the
information it would need to solve the problem.

For now, could you just generate an unlock request in the case where you
get an error on the write?  That's certainly not perfect, but it's no
worse than the current behavior.

> > +	list_for_each_entry(op, &send_list, list) {
> > +		xop = (struct plock_xop *xop)op;
> > +		if (!xop->callback)
> > +			continue;
> > +		if (xop->fl != fl)
> > +			continue;
> > +		list_del_init(&op->list);
> > +		goto found;
> > +	}
> 
> If found on the send_list, it means the op hasn't been sent up to the lock
> manager yet, so the cancel can be considered a success.
> 
> > +	spin_unlock(&ops_lock);
> > +	/* Too late; the lock's probably already been granted. */
> > +	return -ENOENT;
> 
> It's up to the caller to sort out what happens in this case.

Yup.

--b.



  reply	other threads:[~2007-09-20 15:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-20 14:55 [Cluster-devel] [PATCH] gfs2: fix lock cancelling J. Bruce Fields
2007-09-20 15:31 ` David Teigland
2007-09-20 15:48   ` J. Bruce Fields [this message]
2007-09-20 15:54     ` David Teigland

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=20070920154823.GB19232@fieldses.org \
    --to=bfields@fieldses.org \
    /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.