- Notifications
You must be signed in to change notification settings - Fork5
Commit049469e
committed
Teach mdnblocks() not to create zero-length files.
It's entirely surprising that mdnblocks() has the side effect ofcreating new files on disk, so let's make it not do that. Oneconsequence of the old behavior is that, if running on a damagedcluster that is missing a file, mdnblocks() can recreate the fileand allow a subsequent _mdfd_getseg() for a higher segment to succeed.This happens because, while mdnblocks() stops when it finds a segmentthat is shorter than 1GB, _mdfd_getseg() has no such check, and thusthe empty file created by mdnblocks() can allow it to continue itstraversal and find higher-numbered segments which remain.It might be a good idea for _mdfd_getseg() to actually verify thateach segment it finds is exactly 1GB before proceeding to the nextone, but that would involve some additional system calls, so fornow I'm just doing this much.Patch by me, per off-list analysis by Kevin Grittner and Rahila Syed.Review by Andres Freund.1 parent6150a1b commit049469e
1 file changed
+7
-9
lines changedLines changed: 7 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
848 | 848 |
| |
849 | 849 |
| |
850 | 850 |
| |
851 |
| - | |
852 |
| - | |
853 |
| - | |
854 |
| - | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
855 | 856 |
| |
856 |
| - | |
| 857 | + | |
857 | 858 |
| |
858 |
| - | |
859 |
| - | |
860 |
| - | |
861 |
| - | |
| 859 | + | |
862 | 860 |
| |
863 | 861 |
| |
864 | 862 |
| |
|
0 commit comments
Comments
(0)