Commit 9372dce
xfs: reclaim speculative preallocations for append only files
The XFS XFS_DIFLAG_APPEND maps to the VFS S_APPEND flag, which forbids
writes that don't append at the current EOF.
But the commit originally adding XFS_DIFLAG_APPEND support (commit
a23321e766d in xfs xfs-import repository) also checked it to skip
releasing speculative preallocations, which doesn't make any sense.
Another commit (dd9f438 in the xfs-import repository) later extended
that flag to also report these speculation preallocations which should
not exist in getbmap.
Remove these checks as nothing XFS_DIFLAG_APPEND implies that
preallocations beyond EOF should exist, but explicitly check for
XFS_DIFLAG_APPEND in xfs_file_release to bypass the algorithm that
discard preallocations on the first close as append only files aren't
expected to be written to only once.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>1 parent 11f4c3a commit 9372dce
3 files changed
+10
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
334 | | - | |
335 | | - | |
| 334 | + | |
336 | 335 | | |
337 | 336 | | |
338 | 337 | | |
| |||
524 | 523 | | |
525 | 524 | | |
526 | 525 | | |
527 | | - | |
528 | | - | |
| 526 | + | |
| 527 | + | |
529 | 528 | | |
530 | | - | |
531 | | - | |
532 | | - | |
| 529 | + | |
| 530 | + | |
533 | 531 | | |
534 | 532 | | |
535 | 533 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1220 | 1220 | | |
1221 | 1221 | | |
1222 | 1222 | | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
1223 | 1226 | | |
1224 | 1227 | | |
1225 | 1228 | | |
| |||
1234 | 1237 | | |
1235 | 1238 | | |
1236 | 1239 | | |
| 1240 | + | |
1237 | 1241 | | |
1238 | 1242 | | |
1239 | 1243 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1159 | 1159 | | |
1160 | 1160 | | |
1161 | 1161 | | |
1162 | | - | |
| 1162 | + | |
1163 | 1163 | | |
1164 | 1164 | | |
1165 | 1165 | | |
| |||
0 commit comments