[Top] [All Lists]

Re: [PATCH 3/3] xfs: zero allocation_args on the kernel stack

To: tinguely@xxxxxxx
Subject: Re: [PATCH 3/3] xfs: zero allocation_args on the kernel stack
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Thu, 20 Sep 2012 09:41:02 +1000
Cc: xfs@xxxxxxxxxxx
In-reply-to: <20120919163145.587098223@xxxxxxx>
References: <20120919163133.097340199@xxxxxxx> <20120919163145.587098223@xxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Wed, Sep 19, 2012 at 11:31:36AM -0500, tinguely@xxxxxxx wrote:
> The allocation argument structures is created on the kernel stack space. This
> patch makes sure the userdata variable is always initialized.
> The better solution is always memset to 0 or "= { 0 }" the xfs_alloc_arg

Yes, please do that and remove all the initialisations to zero
instead. It's much easier to maintain in future if new additions
to structures are automaticlly zeroed by the code that uses it...

> and xfs_bmalloca structures. I believe there will only be 4 places that need
> this memset change.

The only definition of xfs_bmalloca (in xfs_bmapi_write) is already

        struct xfs_bmalloca     bma = { 0 };    /* args for xfs_bmap_alloc */


Dave Chinner

<Prev in Thread] Current Thread [Next in Thread>