[Ocfs2-devel] [PATCH] ocfs2/dlm: call dlm_lockres_put without resource spinlock

Andrew Morton akpm at linux-foundation.org
Wed Oct 1 15:55:49 PDT 2014


On Fri, 26 Sep 2014 16:41:39 +0800 alex chen <alex.chen at huawei.com> wrote:

> dlm_lockres_put should be called without &res->spinlock, otherwise a
> deadlock case may happen.
> 
> spin_lock(&res->spinlock)
> ...
> dlm_lockres_put
>   ->dlm_lockres_release
>     ->dlm_print_one_lock_resource
>       ->spin_lock(&res->spinlock)
> 
> Signed-off-by: Alex Chen <alex.chen at huawei.com>
> Reviewed-by: Joseph Qi <joseph.qi at huawei.com>
> ---
>  fs/ocfs2/dlm/dlmrecovery.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/ocfs2/dlm/dlmrecovery.c b/fs/ocfs2/dlm/dlmrecovery.c
> index 45067fa..3365839 100644
> --- a/fs/ocfs2/dlm/dlmrecovery.c
> +++ b/fs/ocfs2/dlm/dlmrecovery.c
> @@ -1710,9 +1710,12 @@ int dlm_master_requery_handler(struct o2net_msg *msg, u32 len, void *data,
>  				BUG();

This code does a GFP_ATOMIC allocation attempt and if that fails, it
goes BUG().

Guys, GFP_ATOMIC is unreliable.  This isn't production quality code :(





More information about the Ocfs2-devel mailing list