[ewg] [PATCH OFED-1.4.1] NFSRDMA: RHEL5.1 NFS Server locking issue

Vladimir Sokolovsky vlad at dev.mellanox.co.il
Fri Apr 24 11:05:35 PDT 2009


Jon Mason wrote:
> posix_test_lock has changed how it notifies callers of a file being
> locked.  In older versions (like the one in RHEL5.1), it returned an
> integer specifying the file lock state.  In more modern versions, it is
> a void function that sets a flag in the file lock struct.  Since the NFS
> code in the backport expects the flag to be set, callers of this
> function must set it appropriately based on the return code.
> 
> This fixes locking issues experienced running Connectathon against a
> RHEL5.1 NFS Server.
> 
> Signed-Off-By: Jon Mason <jon at opengridcomputing.com>
> ---
> 
> diff --git a/kernel_addons/backport/2.6.18-EL5.1/include/linux/fs.h b/kernel_addons/backport/2.6.18-EL5.1/include/linux/fs.h
> index 00ac858..7937be3 100644
> --- a/kernel_addons/backport/2.6.18-EL5.1/include/linux/fs.h
> +++ b/kernel_addons/backport/2.6.18-EL5.1/include/linux/fs.h
> @@ -62,9 +62,13 @@ static inline void clear_nlink(struct inode *inode)
>  
>  static inline int vfs_test_lock(struct file *filp, struct file_lock *fl)
>  {
> +	int rc;
> +
>  	if (filp->f_op && filp->f_op->lock)
>  		return filp->f_op->lock(filp, F_GETLK, fl);
> -	posix_test_lock(filp, fl, fl);
> +	rc = posix_test_lock(filp, fl, fl);
> +	if (rc == 0)
> +		fl->fl_type = F_UNLCK;
>  	return 0;
>  }
>  

Applied,

Regards,
Vladimir



More information about the ewg mailing list