diff options
Diffstat (limited to 'fs/nilfs2/file.c')
-rw-r--r-- | fs/nilfs2/file.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/nilfs2/file.c b/fs/nilfs2/file.c index 93589fccdd97..397e73258631 100644 --- a/fs/nilfs2/file.c +++ b/fs/nilfs2/file.c | |||
@@ -72,10 +72,9 @@ static int nilfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) | |||
72 | /* | 72 | /* |
73 | * check to see if the page is mapped already (no holes) | 73 | * check to see if the page is mapped already (no holes) |
74 | */ | 74 | */ |
75 | if (PageMappedToDisk(page)) { | 75 | if (PageMappedToDisk(page)) |
76 | unlock_page(page); | ||
77 | goto mapped; | 76 | goto mapped; |
78 | } | 77 | |
79 | if (page_has_buffers(page)) { | 78 | if (page_has_buffers(page)) { |
80 | struct buffer_head *bh, *head; | 79 | struct buffer_head *bh, *head; |
81 | int fully_mapped = 1; | 80 | int fully_mapped = 1; |
@@ -90,7 +89,6 @@ static int nilfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) | |||
90 | 89 | ||
91 | if (fully_mapped) { | 90 | if (fully_mapped) { |
92 | SetPageMappedToDisk(page); | 91 | SetPageMappedToDisk(page); |
93 | unlock_page(page); | ||
94 | goto mapped; | 92 | goto mapped; |
95 | } | 93 | } |
96 | } | 94 | } |
@@ -105,16 +103,17 @@ static int nilfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) | |||
105 | return VM_FAULT_SIGBUS; | 103 | return VM_FAULT_SIGBUS; |
106 | 104 | ||
107 | ret = block_page_mkwrite(vma, vmf, nilfs_get_block); | 105 | ret = block_page_mkwrite(vma, vmf, nilfs_get_block); |
108 | if (unlikely(ret)) { | 106 | if (ret != VM_FAULT_LOCKED) { |
109 | nilfs_transaction_abort(inode->i_sb); | 107 | nilfs_transaction_abort(inode->i_sb); |
110 | return ret; | 108 | return ret; |
111 | } | 109 | } |
110 | nilfs_set_file_dirty(inode, 1 << (PAGE_SHIFT - inode->i_blkbits)); | ||
112 | nilfs_transaction_commit(inode->i_sb); | 111 | nilfs_transaction_commit(inode->i_sb); |
113 | 112 | ||
114 | mapped: | 113 | mapped: |
115 | SetPageChecked(page); | 114 | SetPageChecked(page); |
116 | wait_on_page_writeback(page); | 115 | wait_on_page_writeback(page); |
117 | return 0; | 116 | return VM_FAULT_LOCKED; |
118 | } | 117 | } |
119 | 118 | ||
120 | static const struct vm_operations_struct nilfs_file_vm_ops = { | 119 | static const struct vm_operations_struct nilfs_file_vm_ops = { |