Re: [PATCH] mkfs: fix divide-by-zero in align_ag_geometry

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 20, 2018 at 10:55:20PM -0400, jeffm@xxxxxxxx wrote:
> From: Jeff Mahoney <jeffm@xxxxxxxx>
> 
> Commit 051b4e37f5e (mkfs: factor AG alignment) factored out the
> AG alignment code into a separate function.  It got rid of
> redundant checks for dswidth != 0 but did too good a job since now
> it doesn't check at all.

Of course they got removed - we've already validated the CLI input
and guaranteed that cfg->dswidth can only be zero iff cfg->dsunit is
zero in calc_stripe_factors().

i.e. We do input validation of CLI paramters before anything else so
that later users (like align_ag_geometry()) can assume the
parameters they are using are valid. In this case, the assumption is
that either both dsunit and dswidth are zero or that both are
non-zero and dswidth an integer multple of dsunit.

> When we hit the check to see if agsize
> is a multiple of stripe width: (cfg->agsize % cfg->dswidth), we crash
> on a divide by zero.

What CLI config did you use to hit this? I'd like to reproduce it so
I can see where calc_stripe_factors() is going wrong....

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux