On Wed, 2025-09-03 at 16:04 +0800, Yangtao Li wrote: > Hi Slava, > > 在 2025/8/16 03:49, Viacheslav Dubeyko 写道: > > Currently, hfs_brec_remove() executes moving records > > towards the location of deleted record and it updates > > offsets of moved records. However, the hfs_brec_remove() > > logic ignores the "mess" of b-tree node's free space and > > it doesn't touch the offsets out of records number. > > Potentially, it could confuse fsck or driver logic or > > to be a reason of potential corruption cases. > > Patch looks good, and I don't object to it. > But I don't know what dose it mean > > 'it could confuse fsck or driver logic or to be a reason of potential > corruption cases.' > > > What cases? > > The idea is simple. Let's imagine that we still keep the offsets of deleted records and the "mess" inside of the node after records movement. Currently, only number of records in node's header protects from accessing the offsets of deleted records. But if records number field in node's header will be corrupted somehow, then offsets of deleted records will be considered like the valid offsets. As a result, logic of driver or FSCK will try to access the "records" in the node's body. And this logic will operate with the "mess" or "garbage" that we have after records movements. Finally, it could result in pretty not trivial issues. Thanks, Slava.