diff options
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r-- | fs/ext4/inode.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 17802a96af9f..5c0d17066f4a 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -5286,12 +5286,21 @@ int ext4_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) | |||
5286 | else | 5286 | else |
5287 | len = PAGE_CACHE_SIZE; | 5287 | len = PAGE_CACHE_SIZE; |
5288 | 5288 | ||
5289 | lock_page(page); | ||
5290 | /* | ||
5291 | * return if we have all the buffers mapped. This avoid | ||
5292 | * the need to call write_begin/write_end which does a | ||
5293 | * journal_start/journal_stop which can block and take | ||
5294 | * long time | ||
5295 | */ | ||
5289 | if (page_has_buffers(page)) { | 5296 | if (page_has_buffers(page)) { |
5290 | /* return if we have all the buffers mapped */ | ||
5291 | if (!walk_page_buffers(NULL, page_buffers(page), 0, len, NULL, | 5297 | if (!walk_page_buffers(NULL, page_buffers(page), 0, len, NULL, |
5292 | ext4_bh_unmapped)) | 5298 | ext4_bh_unmapped)) { |
5299 | unlock_page(page); | ||
5293 | goto out_unlock; | 5300 | goto out_unlock; |
5301 | } | ||
5294 | } | 5302 | } |
5303 | unlock_page(page); | ||
5295 | /* | 5304 | /* |
5296 | * OK, we need to fill the hole... Do write_begin write_end | 5305 | * OK, we need to fill the hole... Do write_begin write_end |
5297 | * to do block allocation/reservation.We are not holding | 5306 | * to do block allocation/reservation.We are not holding |