Skip to content

Commit 394e7f4

Browse files
chaseyuJaegeuk Kim
authored andcommitted
f2fs: don't set FI_PREALLOCATED_ALL for partial write
In f2fs_preallocate_blocks(), if it is partial write in 4KB, it's not necessary to call f2fs_map_blocks() and set FI_PREALLOCATED_ALL flag. Cc: Eric Biggers <ebiggers@google.com> Signed-off-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
1 parent bb34cc6 commit 394e7f4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

fs/f2fs/file.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4567,7 +4567,8 @@ static int f2fs_preallocate_blocks(struct kiocb *iocb, struct iov_iter *iter,
45674567
if (map.m_len > map.m_lblk)
45684568
map.m_len -= map.m_lblk;
45694569
else
4570-
map.m_len = 0;
4570+
return 0;
4571+
45714572
map.m_may_create = true;
45724573
if (dio) {
45734574
map.m_seg_type = f2fs_rw_hint_to_seg_type(inode->i_write_hint);

0 commit comments

Comments
 (0)