Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2: nilfs2: fix whitespace coding style issues nilfs2: fix oops due to a bad aops initialization nilfs2: fix data loss in mmap page write for hole blocks
This commit is contained in:
commit
85cf0ac38c
3 changed files with 15 additions and 14 deletions
|
@ -72,10 +72,9 @@ static int nilfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
|
|||
/*
|
||||
* check to see if the page is mapped already (no holes)
|
||||
*/
|
||||
if (PageMappedToDisk(page)) {
|
||||
unlock_page(page);
|
||||
if (PageMappedToDisk(page))
|
||||
goto mapped;
|
||||
}
|
||||
|
||||
if (page_has_buffers(page)) {
|
||||
struct buffer_head *bh, *head;
|
||||
int fully_mapped = 1;
|
||||
|
@ -90,7 +89,6 @@ static int nilfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
|
|||
|
||||
if (fully_mapped) {
|
||||
SetPageMappedToDisk(page);
|
||||
unlock_page(page);
|
||||
goto mapped;
|
||||
}
|
||||
}
|
||||
|
@ -105,16 +103,17 @@ static int nilfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
|
|||
return VM_FAULT_SIGBUS;
|
||||
|
||||
ret = block_page_mkwrite(vma, vmf, nilfs_get_block);
|
||||
if (unlikely(ret)) {
|
||||
if (ret != VM_FAULT_LOCKED) {
|
||||
nilfs_transaction_abort(inode->i_sb);
|
||||
return ret;
|
||||
}
|
||||
nilfs_set_file_dirty(inode, 1 << (PAGE_SHIFT - inode->i_blkbits));
|
||||
nilfs_transaction_commit(inode->i_sb);
|
||||
|
||||
mapped:
|
||||
SetPageChecked(page);
|
||||
wait_on_page_writeback(page);
|
||||
return 0;
|
||||
return VM_FAULT_LOCKED;
|
||||
}
|
||||
|
||||
static const struct vm_operations_struct nilfs_file_vm_ops = {
|
||||
|
|
|
@ -495,12 +495,14 @@ unsigned nilfs_page_count_clean_buffers(struct page *page,
|
|||
void nilfs_mapping_init(struct address_space *mapping,
|
||||
struct backing_dev_info *bdi)
|
||||
{
|
||||
static const struct address_space_operations empty_aops;
|
||||
|
||||
mapping->host = NULL;
|
||||
mapping->flags = 0;
|
||||
mapping_set_gfp_mask(mapping, GFP_NOFS);
|
||||
mapping->assoc_mapping = NULL;
|
||||
mapping->backing_dev_info = bdi;
|
||||
mapping->a_ops = NULL;
|
||||
mapping->a_ops = &empty_aops;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue