diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-05-07 11:52:57 -0400 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-05-07 13:44:57 -0400 |
commit | 0080c5076409d211fbe28d6f07966f7d39e58bad (patch) | |
tree | 580bffd1c8dfb3de63e4f446bfb3db2d43c4f779 /fs/f2fs/data.c | |
parent | 79344efb93a26378a91193bed133cee42162cd81 (diff) |
f2fs: do not preallocate block unaligned to 4KB
Previously f2fs_preallocate_blocks() tries to allocate unaligned blocks.
In f2fs_write_begin(), however, prepare_write_begin() does not skip its
allocation due to (len != 4KB).
So, it needs locking node page twice unexpectedly.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/data.c')
-rw-r--r-- | fs/f2fs/data.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 96b035319889..369d953bd770 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c | |||
@@ -582,8 +582,8 @@ ssize_t f2fs_preallocate_blocks(struct kiocb *iocb, struct iov_iter *from) | |||
582 | struct f2fs_map_blocks map; | 582 | struct f2fs_map_blocks map; |
583 | ssize_t ret = 0; | 583 | ssize_t ret = 0; |
584 | 584 | ||
585 | map.m_lblk = F2FS_BYTES_TO_BLK(iocb->ki_pos); | 585 | map.m_lblk = F2FS_BLK_ALIGN(iocb->ki_pos); |
586 | map.m_len = F2FS_BLK_ALIGN(iov_iter_count(from)); | 586 | map.m_len = F2FS_BYTES_TO_BLK(iov_iter_count(from)); |
587 | map.m_next_pgofs = NULL; | 587 | map.m_next_pgofs = NULL; |
588 | 588 | ||
589 | if (f2fs_encrypted_inode(inode)) | 589 | if (f2fs_encrypted_inode(inode)) |