[patch] CIFS: double unlock in cifs_lock_add_if()

Pavel Shilovsky piastry at etersoft.ru
Sat Oct 29 01:25:06 MDT 2011


2011/10/29 Dan Carpenter <dan.carpenter at oracle.com>:
> We unlocked "cinode->lock_mutex" twice so I've removed the first
> unlock.
>
> Signed-off-by: Dan Carpenter <dan.carpenter at oracle.com>
>
> diff --git a/fs/cifs/file.c b/fs/cifs/file.c
> index ea096ce..b8dbab8 100644
> --- a/fs/cifs/file.c
> +++ b/fs/cifs/file.c
> @@ -775,11 +775,9 @@ try_again:
>                                        (lock->blist.next == &lock->blist));
>                if (!rc)
>                        goto try_again;
> -               else {
> -                       mutex_lock(&cinode->lock_mutex);
> -                       list_del_init(&lock->blist);
> -                       mutex_unlock(&cinode->lock_mutex);
> -               }
> +
> +               mutex_lock(&cinode->lock_mutex);
> +               list_del_init(&lock->blist);
>        }
>
>        kfree(lock);
> --
> To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

I recently posted the similar fix "CIFS: Remove extra mutex_unlock in
cifs_lock_add_if":
https://git.samba.org/sfrench/?p=sfrench/cifs-2.6.git;a=commitdiff;h=d12799b4c3c4d1e65d7fdbb5d91538c92d6863dd;hp=f362f98e7c445643d27c610bb7a86b79727b592e

Anyway, thanks for catching this!

-- 
Best regards,
Pavel Shilovsky.


More information about the samba-technical mailing list