On Thu, Nov 09, 2017 at 03:39:44PM -0800, Darrick J. Wong wrote: > From: Darrick J. Wong <darrick.wong@xxxxxxxxxx> > > Make sure we don't list a block twice in the agfl by copying the > contents of the AGFL to an array, sorting it, and looking for > duplicates. We can easily check that the number of agfl entries we see > actually matches the flcount, so do that too. > > Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx> > --- > v3: check flcount, don't overflow buffer > v2: minor reworks per dchinner review suggestions Looks good. One minor nit: > + sai.entries = kmem_zalloc(sizeof(xfs_agblock_t) * agflcount, > + KM_SLEEP | KM_NOFS); > + if (!sai.entries) { > + error = -ENOMEM; > + goto out; > + } KM_SLEEP means "never fail", which would make either it or the error checking redundant. I'd just drop the KM_SLEEP - it's not necessary if we can handle ENOMEM effectively. Otherwise it looks good. Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx> -- 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