Re: [PATCH v3 1/5] xfs: check the uniqueness of the AGFL entries

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

 



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



[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