mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: ASANO Masahiro <masano@tnes.nec.co.jp>
Cc: matthew@wil.cx, linux-kernel@vger.kernel.org,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] fix posix lock on NFS, #2
Date: Fri, 23 Dec 2005 16:02:31 +0100	[thread overview]
Message-ID: <1135350151.8167.160.camel@lade.trondhjem.org> (raw)
In-Reply-To: <20051223.233839.846934653.masano@tnes.nec.co.jp>

On Fri, 2005-12-23 at 23:38 +0900, ASANO Masahiro wrote:
> Here is a patch.  It changes nfsd to keep the range of file_lock for
> later use.  Any comments and feedback are welcome.
> 
> Signed-off-by: ASANO Masahiro <masano@tnes.nec.co.jp>
> 
> --- linux-2.6.15-rc6/fs/lockd/svclock.c.orig	2005-12-23 20:16:33.000000000 +0900
> +++ linux-2.6.15-rc6/fs/lockd/svclock.c	2005-12-23 20:24:13.000000000 +0900
> @@ -510,6 +510,7 @@ nlmsvc_grant_blocked(struct nlm_block *b
>  	struct nlm_file		*file = block->b_file;
>  	struct nlm_lock		*lock = &block->b_call.a_args.lock;
>  	struct file_lock	*conflock;
> +	struct file_lock	tmplck;
>  	int			error;
>  
>  	dprintk("lockd: grant blocked lock %p\n", block);
> @@ -542,7 +543,8 @@ nlmsvc_grant_blocked(struct nlm_block *b
>  	 * following yields an error, this is most probably due to low
>  	 * memory. Retry the lock in a few seconds.
>  	 */
> -	if ((error = posix_lock_file(file->f_file, &lock->fl)) < 0) {
> +	tmplck = lock->fl;	/* keep the range for later use */
> +	if ((error = posix_lock_file(file->f_file, &tmplck)) < 0) {
>  		printk(KERN_WARNING "lockd: unexpected error %d in %s!\n",
>  				-error, __FUNCTION__);
>  		nlmsvc_insert_block(block, 10 * HZ);

NACK. You cannot copy locks like this. See locks_copy_lock().

Cheers,
  Trond


  reply	other threads:[~2005-12-23 15:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-23 14:38 ASANO Masahiro
2005-12-23 15:02 ` Trond Myklebust [this message]
2005-12-24  2:56   ` ASANO Masahiro

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=1135350151.8167.160.camel@lade.trondhjem.org \
    --to=trond.myklebust@fys.uio.no \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masano@tnes.nec.co.jp \
    --cc=matthew@wil.cx \
    /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®