[PATCH 3/3] xfs: zero allocation_args on the kernel stack
Dave Chinner
david at fromorbit.com
Wed Sep 19 18:41:02 CDT 2012
On Wed, Sep 19, 2012 at 11:31:36AM -0500, tinguely at sgi.com 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
zeroed:
struct xfs_bmalloca bma = { 0 }; /* args for xfs_bmap_alloc */
Cheers,
Dave.
--
Dave Chinner
david at fromorbit.com
More information about the xfs
mailing list