[Ocfs2-devel] ocfs2: initialize stack_user lvbptr

Joel Becker Joel.Becker at oracle.com
Mon Nov 10 14:55:07 PST 2008


On Mon, Nov 10, 2008 at 04:24:57PM -0600, David Teigland wrote:
> commit 3d48397962cdad2aa32df75cfdae980af9bce8cc
> Author: David Teigland <teigland at redhat.com>
> Date:   Mon Nov 10 16:16:07 2008 -0600
> 
>     ocfs2: initialize stack_user lvbptr
>     
>     The locking_state dump, ocfs2_dlm_seq_show, reads the lvb on locks
>     where it has not yet been initialized by a lock call.
>     
>     Signed-off-by: David Teigland <teigland at redhat.com>

Acked-by: Joel Becker <joel.becker at oracle.com>

> 
> diff --git a/fs/ocfs2/stack_user.c b/fs/ocfs2/stack_user.c
> index faec2d8..9b76d41 100644
> --- a/fs/ocfs2/stack_user.c
> +++ b/fs/ocfs2/stack_user.c
> @@ -740,6 +740,9 @@ static int user_dlm_lock_status(union ocfs2_dlm_lksb *lksb)
>  
>  static void *user_dlm_lvb(union ocfs2_dlm_lksb *lksb)
>  {
> +	if (!lksb->lksb_fsdlm.sb_lvbptr)
> +		lksb->lksb_fsdlm.sb_lvbptr = (char *)lksb +
> +					     sizeof(struct dlm_lksb);
>  	return (void *)(lksb->lksb_fsdlm.sb_lvbptr);
>  }
>  

-- 

"What does it say about a society's priorities when the time you
 spend in meetings on Monday is greater than the total number of
 hours you spent sleeping over the weekend?"
	- Nat Friedman

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127



More information about the Ocfs2-devel mailing list