Re: [PATCH 4/5] libxfs: Catch non-empty zones on destroy

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

 




On 3/6/18 5:06 PM, Darrick J. Wong wrote:
>> @@ -887,11 +893,15 @@ libxfs_umount(xfs_mount_t *mp)
>>  void
>>  libxfs_destroy(void)
>>  {
>> +	int	leaked;
>> +
>>  	/* Free everything from the buffer cache before freeing buffer zone */
>>  	libxfs_bcache_purge();
>>  	libxfs_bcache_free();
>>  	cache_destroy(libxfs_bcache);
>> -	manage_zones(1);
>> +	leaked = manage_zones(1);
>> +	if (getenv("LIBXFS_LEAK_CHECK") && leaked)
>> +		exit(1);
> What do you think of assert(getenv() == NULL || !leaked); here?
> LIBXFS_LEAK_CHECK is a debugging option, so we might as well dump core
> right where we violate the assumptions.
> 
> (OTOH I guess this probably happens at program exit anyway...)

I don't think a core dump will be that useful, we already print out
which zone leaked & how much - I don't think a core would tell us more...?

-Eric
--
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