All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabio M. Di Nitto <fdinitto@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH] dlm_controld: fix plock dev_write no op
Date: Fri, 19 Aug 2011 08:36:53 +0200	[thread overview]
Message-ID: <4E4E0485.7070102@redhat.com> (raw)
In-Reply-To: <20110818193837.GA315@redhat.com>

The patch looks simple and safe. Does it apply only to rhel6 or also
upstream?

Fabio

On 8/18/2011 9:38 PM, David Teigland wrote:
> When a plock unlock is received due to the file
> being closed (the CLOSE flag is set), we should
> not write an unlock result back to the kernel.
> If we do, the kernel, which does not expect a
> reply, will report the error "dev_write no op".
> 
> In cases where dlm_controld encounters and error
> handling the unlock operation, it was writing
> the error result back to the kernel, even though
> the unlock was flagged with CLOSE.  The fix is
> to check for the CLOSE flag and skip writing
> the error result, as we do with normal results.
> 
> This problem is especially visible when using
> flocks (not plocks).  This is because the kernel
> generates extraneous plock unlock requests
> when files are closed with flocks.  Because
> dlm_controld finds no plocks on the files,
> it replies to the kernel with an error, rather
> than skipping the reply to do CLOSE.
> 
> bz 731775
> 
> Signed-off-by: David Teigland <teigland@redhat.com>
> ---
>  group/dlm_controld/plock.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/group/dlm_controld/plock.c b/group/dlm_controld/plock.c
> index 6d5dea8..556993b 100644
> --- a/group/dlm_controld/plock.c
> +++ b/group/dlm_controld/plock.c
> @@ -1583,8 +1583,10 @@ void process_plocks(int ci)
>  	return;
>  
>   fail:
> -	info.rv = rv;
> -	rv = write(plock_device_fd, &info, sizeof(info));
> +	if (!(info.flags & DLM_PLOCK_FL_CLOSE)) {
> +		info.rv = rv;
> +		rv = write(plock_device_fd, &info, sizeof(info));
> +	}
>  }
>  
>  void process_saved_plocks(struct lockspace *ls)



      reply	other threads:[~2011-08-19  6:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-18 19:38 [Cluster-devel] [PATCH] dlm_controld: fix plock dev_write no op David Teigland
2011-08-19  6:36 ` Fabio M. Di Nitto [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=4E4E0485.7070102@redhat.com \
    --to=fdinitto@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 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.