Re: [PATCH] fix posix lock on NFS, #2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <[email protected]>
> 
> --- 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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux