You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Library case fix uses link(), which fails with EOPNOTSUPP on /data #229
On a PS5 Pro, firmware 12.00, link() and linkat() on /data fail with errno 45 (EOPNOTSUPP): /data has no hard links.
repair_module_case_for_source() in src/sm_scan.c (0b56a1c, line 589) uses link() and then unlink() to give a library its case-correct name without replacing another file:
// link() publishes the new name atomically without replacing another file.if (link(file->path, target) !=0) {
if (errno==EEXIST) {
++conflicts;
} else {
++failures;
For a folder game on /data (for example /data/homebrew/<game>/sce_module/...) this always takes the failures path, so the case fix never happens there. I found the EOPNOTSUPP in a fork that publishes other files the same way; I have not seen this specific function fail in upstream logs, since it needs a game folder whose library names differ only in case.
What we used: when link() fails with EOPNOTSUPP/ENOTSUP, check that the target does not exist (lstat -> ENOENT) and rename() instead. It loses the atomic no-replace guarantee, but the scan holds the folder and the case-only rename is in one directory:
intlink_rc=link(file->path, target);
if (link_rc!=0&& (errno==EOPNOTSUPP||errno==ENOTSUP)) {
structstatexisting;
if (lstat(target, &existing) ==0) {
errno=EEXIST;
} elseif (errno==ENOENT&&rename(file->path, target) ==0) {
/* renamed: update file->path, count it as fixed, continue */
}
}
Not tested: this path on an exFAT image (read-only there anyway) or on case-insensitive storage, where lstat(target) finds the same file and it would count as a conflict. I can open a PR if you want it.
Activity