Defrag.exfat Is Inefficient and Dangerous
Posted by dxdxdt 3 days ago
Comments
Comment by ycombinatrix 3 days ago
Sir, this is a correctness issue.
Comment by zapzupnz 3 days ago
Comment by rcxdude 2 days ago
Comment by burnt-resistor 3 days ago
If a user has double storage available, it's probably best to do the old-fashioned "defrag" by single-threaded copying all files and file metadata to a newly-formatted volume.
Comment by doubled112 3 days ago
At our size and use case the timing was usually close to perfect. The pools were getting close to full and fragmented as larger disks became inexpensive.
Comment by dxdxdt 2 days ago
Read the defrag code in other well-established fs like ext4 or btrfs. They all have limitations(or caveats, if you will). It's one of those problems where you just have to throw money at it and hope for the best. Even Microsoft kinda just gave up on it because it's really a pointless exercise at this point in time and age.
Comment by forgotpwd16 3 days ago
Will call it a human slop. AI may've given them some code but they certainly haven't use it fully. I uploaded the defrag.c in ChatGPT asking to review on performance/correctness/safety and pointed the sames issues as you (alongside bunch of others but not interested at the moment to review them).
Comment by dxdxdt 2 days ago
The code base is huge for an LLM to handle, perhaps it was generated over multiple prompts idk. Not sure if someone can train a model on the kernel code or exfatprogs and generate the code. I doubt someone with such expertise would even go through the process when they can just write the code themselves which is much easier.
Comment by forgotpwd16 2 days ago
>Not sure if someone can train a model on the kernel code or exfatprogs and generate the code.
They can certainly finetune such a model. Not a crazy idea, just computationally expensive. (But less expensive than training from scratch.)
*Of course Linux driver also uses many includes so if consider those alongside linked code the number goes significantly up.
Comment by dxdxdt 2 days ago
Model training requires GPUs w/ 1kW TDP. I can shit out code on noodles and red bulls. Not sure about the quality, but still way less energy :)
Jokes aside, the defrag program probably was a slob to some extent.
Comment by stuaxo 3 days ago
Seems like they are very new to tbings and didn't expect it to be adopted, but were hoping for a bit of feedback.