Commit 4cc0bec
committed
Do not crash when handling files of exactly maximum allowed size
Test case:
1) Mount geesefs with --part-sizes 5
2) Reproduce the bug with the following bash script:
```
perl -e 'open FD, ">test-will-die"; sleep 20' &
dd if=/dev/zero of=test-will-die oflag=direct bs=1M seek=0 count=200
dd if=/dev/zero of=test-will-die oflag=direct bs=1M seek=49999 count=1
sleep 20
```
I.e. to reproduce the bug, you should have the last write to an inode end
at maximum possible file offset, it should also have more modified data
than just the last part, and there should be an open file descriptor for
that file.
3) GeeseFS will crash.1 parent 5a517ef commit 4cc0bec
1 file changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
67 | 71 | | |
68 | 72 | | |
69 | 73 | | |
| |||
0 commit comments