Hi there, I recently made a change in android's selinux repo. The change implements a new lookup helper function for context matches, and it aims to skip unnecessary restorecon if the corresponding context doesn't change. Quote from the commit message. "We used to hash the file_context and skip the restorecon on the top level directory if the hash doesn't change. But the file_context might change after an OTA update; and some users experienced long restorecon time as they have lots of files under directories like /data/media. This CL tries to hash all the partial match entries in the file_context for each directory; and skips the restorecon if that digest stays the same, regardless of the changes to the other parts of file_context." CL in: https://android-review.googlesource.com/c/platform/external/selinux/+/918713 I haven't done the work in upstream code to fully implement this change. But this CL merges and compiles. It factors out a lookup helper function and returns an array of matched pointers instead of a single one. The old loopup_common function is then modified to take the first element in the array. I wonder if it's possible to merge in this change to the lookup functions first? It will make the upstream & android repo more consistent and also save some work for future merges.