f2fs with Android story is always complicated.
So why is SuperSU broken with many custom ROMs:
systemless SuperSU saves a raw ext4 image in /data/su.img and mounts it as a loopback device and to various locations upon boot.
The problem with f2fs, is that most kernels included in custom ROMs have issues with managing loopback devices.
This is not SuperSU issue, rather, kernel developers has to incorporate the necessary fix for f2fs.
This “fix” is rather dumb :
The f2fs head, Kim Jaegeuk forgot to add those pointer to post-4.10 versions of f2fs backports.
(The stock OnePlus 3T’s kernel source code seems to already have this fix. This explains why OxygenOS didn’t have any issues with SuperSU.)
So you have 2 choices :
A. Cherry-pick that fix separately
B. Merge f2fs version all the way up to 4.10(latest f2fs-stable.git is updated to 4.10)
But there are more stories to be told, unfortunately.
Both 2 methods introduce a new problem : breaks all previous f2fs versions to read the data.
There is no on-disk-format change introduced by the new “fix”, but it turns out that older versions of f2fs has an issue which is exploited only when newer version of f2fs is used to write data.
You need this additional fix, if you have no intention to update f2fs to the latest 4.10 version :
Without this fix, the kernel will panic upon reading any data.
So we took care of the method A.
However, there is still an issue with method B : deadlock.
As noted in https://review.lineageos.org/#/c/95316/ , there are deadlocks present on the latest version of f2fs(from 4.8, iirc).
It took about a month to bisect it, and I got the culprit commit :
I’m still yet to hear from the upstream developers, but I can confirm that reverting that commit fixes the deadlock.
Our internal AOSPA builds are running on 4.10 f2fs with that commit reverted.
It’s not @Chainfire 's fault.
You have to ask the kernel developer to fix the issue.
2 methods for the kernel developers
A. Incorporate only the necessary 2 fixes to fix loopback images :
B. If you want to upstream f2fs to the latest 4.10, revert this to avoid deadlock :
(A little credit would be appreciated, as it took me a frustrating month to bisect this)
@Razor10707, I take it you tried 2.80 then tried newer versions? How did you remove the previous flash before flashing the next version?
I'd first do a nandroid backup, then dirty flash your ROM again to get everything back to a known condition. Boot first to make sure everything is working then try SR5 and see if it flashes correctly.
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
After I dirty flashed Nougat and Odined TWRP, I still cant get root. I Odined SuperSu but after that I got this message: "Verification Failed, Unable to restart your device. The Integrity verification has failed. You need to reset your device to factory default settings. This will erase all your data."
I then dirty flashed Nougat and everything is ok. But I still dont have root. I used this SuperSu: SR5-SuperSU-v2.82-SR5-20171001224502.
What do you suggest to get root?
|Thread Tools||Search this Thread|