Re: [PATCH] cifs: handle lease F_UNLCK requests properly

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

 



Merged into cifs-2.6.git

Did you find this with a test case or by inspection?

On Sat, Aug 9, 2014 at 9:16 AM, Jeff Layton <jlayton@xxxxxxxxxxxxxxx> wrote:
> Currently any F_UNLCK request for a lease just gets back -EAGAIN. Allow
> them to go immediately to generic_setlease instead.
>
> Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxxxxxxx>
> ---
>  fs/cifs/cifsfs.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
> index 2c90d07c0b3a..f1a93d2b108d 100644
> --- a/fs/cifs/cifsfs.c
> +++ b/fs/cifs/cifsfs.c
> @@ -799,8 +799,9 @@ static int cifs_setlease(struct file *file, long arg, struct file_lock **lease)
>         if (!(S_ISREG(inode->i_mode)))
>                 return -EINVAL;
>
> -       /* check if file is oplocked */
> -       if (((arg == F_RDLCK) && CIFS_CACHE_READ(CIFS_I(inode))) ||
> +       /* Check if file is oplocked if this is request for new lease */
> +       if (arg == F_UNLCK ||
> +           ((arg == F_RDLCK) && CIFS_CACHE_READ(CIFS_I(inode))) ||
>             ((arg == F_WRLCK) && CIFS_CACHE_WRITE(CIFS_I(inode))))
>                 return generic_setlease(file, arg, lease);
>         else if (tlink_tcon(cfile->tlink)->local_lease &&
> --
> 1.9.3
>



-- 
Thanks,

Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux