diff options
author | Eric Biggers <ebiggers@google.com> | 2021-07-16 16:39:13 +0200 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2021-11-17 20:28:22 +0100 |
commit | 3d697a4a6b7dab8fb8a8c928b640999af3a08d87 (patch) | |
tree | f68807abdbcf9ad45ae4bb0e2c3edc6dd86b99e2 /fs/orangefs/waitqueue.c | |
parent | f2fs: compress: reduce one page array alloc and free when write compressed page (diff) | |
download | linux-3d697a4a6b7dab8fb8a8c928b640999af3a08d87.tar.xz linux-3d697a4a6b7dab8fb8a8c928b640999af3a08d87.zip |
f2fs: rework write preallocations
f2fs_write_begin() assumes that all blocks were preallocated by
default unless FI_NO_PREALLOC is explicitly set. This invites data
corruption, as there are cases in which not all blocks are preallocated.
Commit 47501f87c61a ("f2fs: preallocate DIO blocks when forcing
buffered_io") fixed one case, but there are others remaining.
Fix up this logic by replacing this flag with FI_PREALLOCATED_ALL, which
only gets set if all blocks for the current write were preallocated.
Also clean up f2fs_preallocate_blocks(), move it to file.c, and make it
handle some of the logic that was previously in write_iter() directly.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/orangefs/waitqueue.c')
0 files changed, 0 insertions, 0 deletions