diff options
Diffstat (limited to 'fs/ubifs/file.c')
-rw-r--r-- | fs/ubifs/file.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c index b286db79c686..3f254e37b25b 100644 --- a/fs/ubifs/file.c +++ b/fs/ubifs/file.c | |||
@@ -971,11 +971,11 @@ static int do_writepage(struct page *page, int len) | |||
971 | * the page locked, and it locks @ui_mutex. However, write-back does take inode | 971 | * the page locked, and it locks @ui_mutex. However, write-back does take inode |
972 | * @i_mutex, which means other VFS operations may be run on this inode at the | 972 | * @i_mutex, which means other VFS operations may be run on this inode at the |
973 | * same time. And the problematic one is truncation to smaller size, from where | 973 | * same time. And the problematic one is truncation to smaller size, from where |
974 | * we have to call 'truncate_setsize()', which first changes @inode->i_size, then | 974 | * we have to call 'truncate_setsize()', which first changes @inode->i_size, |
975 | * drops the truncated pages. And while dropping the pages, it takes the page | 975 | * then drops the truncated pages. And while dropping the pages, it takes the |
976 | * lock. This means that 'do_truncation()' cannot call 'truncate_setsize()' with | 976 | * page lock. This means that 'do_truncation()' cannot call 'truncate_setsize()' |
977 | * @ui_mutex locked, because it would deadlock with 'ubifs_writepage()'. This | 977 | * with @ui_mutex locked, because it would deadlock with 'ubifs_writepage()'. |
978 | * means that @inode->i_size is changed while @ui_mutex is unlocked. | 978 | * This means that @inode->i_size is changed while @ui_mutex is unlocked. |
979 | * | 979 | * |
980 | * XXX(truncate): with the new truncate sequence this is not true anymore, | 980 | * XXX(truncate): with the new truncate sequence this is not true anymore, |
981 | * and the calls to truncate_setsize can be move around freely. They should | 981 | * and the calls to truncate_setsize can be move around freely. They should |
@@ -1432,10 +1432,11 @@ static int ubifs_releasepage(struct page *page, gfp_t unused_gfp_flags) | |||
1432 | } | 1432 | } |
1433 | 1433 | ||
1434 | /* | 1434 | /* |
1435 | * mmap()d file has taken write protection fault and is being made | 1435 | * mmap()d file has taken write protection fault and is being made writable. |
1436 | * writable. UBIFS must ensure page is budgeted for. | 1436 | * UBIFS must ensure page is budgeted for. |
1437 | */ | 1437 | */ |
1438 | static int ubifs_vm_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) | 1438 | static int ubifs_vm_page_mkwrite(struct vm_area_struct *vma, |
1439 | struct vm_fault *vmf) | ||
1439 | { | 1440 | { |
1440 | struct page *page = vmf->page; | 1441 | struct page *page = vmf->page; |
1441 | struct inode *inode = vma->vm_file->f_path.dentry->d_inode; | 1442 | struct inode *inode = vma->vm_file->f_path.dentry->d_inode; |