Page MenuHomeFreeBSD

Get rid of superfluous "bug marker" code in the bcache
ClosedPublic

Authored by sobomax on Nov 22 2018, 6:16 PM.
Tags
None
Referenced Files
F132459623: D18299.id51026.diff
Fri, Oct 17, 2:59 AM
F132421876: D18299.id50920.diff
Thu, Oct 16, 7:26 PM
F132421875: D18299.id.diff
Thu, Oct 16, 7:26 PM
F132421874: D18299.id51026.diff
Thu, Oct 16, 7:26 PM
F132378620: D18299.diff
Thu, Oct 16, 9:24 AM
Unknown Object (File)
Sat, Oct 11, 2:33 AM
Unknown Object (File)
Mon, Oct 6, 3:29 AM
Unknown Object (File)
Sat, Oct 4, 6:42 AM
Subscribers

Details

Summary

Read-ahead code introduced in the r313332 contains "the end of cache marker" which I believe superfluous, as cache is allocated on heap and there is already a similar code in the malloc()/free() to detect data corruption and panic:

$ grep USEENDGUARD /usr/src/stand/libsa/*.[ch]
/usr/src/stand/libsa/zalloc_defs.h:#define USEENDGUARD
/usr/src/stand/libsa/zalloc_malloc.c:#ifdef USEENDGUARD
/usr/src/stand/libsa/zalloc_malloc.c:#ifdef USEENDGUARD
/usr/src/stand/libsa/zalloc_malloc.c:#ifdef USEENDGUARD

I believe that code is more "correct" since such incidents should not be taken lightly as often loader logs are not easily available and or often looked upon. Merely issuing a warning when condition is detected is not sufficient since allowing system to continue bootstrap is likely to cause a subsequent kernel crash/misbehaviour that would be really hard to debug and can lead to a severe data corruption as well.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Good by me - I did add this for extra safety because the malloc markers are checked on free. And since we havent been bitten yet, I guess we are good:)

This revision is now accepted and ready to land.Nov 22 2018, 6:22 PM
This revision was automatically updated to reflect the committed changes.