Ext4 is only supported in nAOSP roms 5.1 and earlier. All other version of nAOSP (6.0 and later) require F2FS data and cache partitions.
So, if it is required by the version of nAOSP rom you wish to flash that you F2FS partition on /data and /cache, read and follow the easy instructions below to get it done via TWRP recovery without stress.
How To Convert To F2FS
- First, boot into TWRP recovery
- Select Wipe
- Tap Advanced Wipe
- Choose Data
- Now click Repair or Change File system
- Tap Change File System
- Select F2FS
- Finally, Swipe to Change
Now, tap Home and repeat the exact steps above for Cache partition
Once done, reboot the device as suggested by TWRP.
Note: If you still see 0MB or a wrong size for data partition after the reboot, format data (Wipe/Format Data). If that doesn't fix it, convert data to ext4 and back to f2fs.