mds:asok interface to cleanup permanently damaged inodes
There exists a nagging bug in the MDS due to a corrupt on-disk inode causing and assert in the MDS when removing the "corrupted" file. The corruption has been reported in this tracker: https://tracker.ceph.com/issues/38452 and happens when using PostgreSQL with CephFS. The workaround for this is to remove the corrupted inodes omap key/value entry from its corresponding parent rados object. While this workaround the crash MDS, it leaves the non-primary links in a dangling state (since the primary link was removed to workaround the crash) and gets ended up being marked as damaged by the MDS thereby rendering it inaccessible.
At times, these damaged links are not of much interest (as seen in some installations, where the files are a part of a CephFS subvolume which is under deletion), however, one still cannot remove such damaged links. For such occasions, its probably safe to remove the damaged inode metadata ("link" on-disk inode). Provide a mechanism for the administrator to purge damaged metadata for inodes of damage_type "backtrace" (bad remote dentry).
- ceph tell mds.<> damage purge <id>