diff options
Diffstat (limited to 'fs/ubifs')
-rw-r--r-- | fs/ubifs/Kconfig | 4 | ||||
-rw-r--r-- | fs/ubifs/file.c | 9 | ||||
-rw-r--r-- | fs/ubifs/super.c | 3 |
3 files changed, 10 insertions, 6 deletions
diff --git a/fs/ubifs/Kconfig b/fs/ubifs/Kconfig index e35b54d5059d..830e3f76f442 100644 --- a/fs/ubifs/Kconfig +++ b/fs/ubifs/Kconfig | |||
@@ -22,7 +22,7 @@ config UBIFS_FS_ADVANCED_COMPR | |||
22 | depends on UBIFS_FS | 22 | depends on UBIFS_FS |
23 | help | 23 | help |
24 | This option allows to explicitly choose which compressions, if any, | 24 | This option allows to explicitly choose which compressions, if any, |
25 | are enabled in UBIFS. Removing compressors means inbility to read | 25 | are enabled in UBIFS. Removing compressors means inability to read |
26 | existing file systems. | 26 | existing file systems. |
27 | 27 | ||
28 | If unsure, say 'N'. | 28 | If unsure, say 'N'. |
@@ -32,7 +32,7 @@ config UBIFS_FS_LZO | |||
32 | depends on UBIFS_FS | 32 | depends on UBIFS_FS |
33 | default y | 33 | default y |
34 | help | 34 | help |
35 | LZO compressor is generally faster then zlib but compresses worse. | 35 | LZO compressor is generally faster than zlib but compresses worse. |
36 | Say 'Y' if unsure. | 36 | Say 'Y' if unsure. |
37 | 37 | ||
38 | config UBIFS_FS_ZLIB | 38 | config UBIFS_FS_ZLIB |
diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c index 4e256b8f56b2..6d34dc7e33e1 100644 --- a/fs/ubifs/file.c +++ b/fs/ubifs/file.c | |||
@@ -1444,8 +1444,9 @@ static int ubifs_releasepage(struct page *page, gfp_t unused_gfp_flags) | |||
1444 | * mmap()d file has taken write protection fault and is being made | 1444 | * mmap()d file has taken write protection fault and is being made |
1445 | * writable. UBIFS must ensure page is budgeted for. | 1445 | * writable. UBIFS must ensure page is budgeted for. |
1446 | */ | 1446 | */ |
1447 | static int ubifs_vm_page_mkwrite(struct vm_area_struct *vma, struct page *page) | 1447 | static int ubifs_vm_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) |
1448 | { | 1448 | { |
1449 | struct page *page = vmf->page; | ||
1449 | struct inode *inode = vma->vm_file->f_path.dentry->d_inode; | 1450 | struct inode *inode = vma->vm_file->f_path.dentry->d_inode; |
1450 | struct ubifs_info *c = inode->i_sb->s_fs_info; | 1451 | struct ubifs_info *c = inode->i_sb->s_fs_info; |
1451 | struct timespec now = ubifs_current_time(inode); | 1452 | struct timespec now = ubifs_current_time(inode); |
@@ -1457,7 +1458,7 @@ static int ubifs_vm_page_mkwrite(struct vm_area_struct *vma, struct page *page) | |||
1457 | ubifs_assert(!(inode->i_sb->s_flags & MS_RDONLY)); | 1458 | ubifs_assert(!(inode->i_sb->s_flags & MS_RDONLY)); |
1458 | 1459 | ||
1459 | if (unlikely(c->ro_media)) | 1460 | if (unlikely(c->ro_media)) |
1460 | return -EROFS; | 1461 | return VM_FAULT_SIGBUS; /* -EROFS */ |
1461 | 1462 | ||
1462 | /* | 1463 | /* |
1463 | * We have not locked @page so far so we may budget for changing the | 1464 | * We have not locked @page so far so we may budget for changing the |
@@ -1490,7 +1491,7 @@ static int ubifs_vm_page_mkwrite(struct vm_area_struct *vma, struct page *page) | |||
1490 | if (err == -ENOSPC) | 1491 | if (err == -ENOSPC) |
1491 | ubifs_warn("out of space for mmapped file " | 1492 | ubifs_warn("out of space for mmapped file " |
1492 | "(inode number %lu)", inode->i_ino); | 1493 | "(inode number %lu)", inode->i_ino); |
1493 | return err; | 1494 | return VM_FAULT_SIGBUS; |
1494 | } | 1495 | } |
1495 | 1496 | ||
1496 | lock_page(page); | 1497 | lock_page(page); |
@@ -1530,6 +1531,8 @@ static int ubifs_vm_page_mkwrite(struct vm_area_struct *vma, struct page *page) | |||
1530 | out_unlock: | 1531 | out_unlock: |
1531 | unlock_page(page); | 1532 | unlock_page(page); |
1532 | ubifs_release_budget(c, &req); | 1533 | ubifs_release_budget(c, &req); |
1534 | if (err) | ||
1535 | err = VM_FAULT_SIGBUS; | ||
1533 | return err; | 1536 | return err; |
1534 | } | 1537 | } |
1535 | 1538 | ||
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index 302a2056422e..faa44f90608a 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c | |||
@@ -2051,7 +2051,8 @@ static int ubifs_get_sb(struct file_system_type *fs_type, int flags, | |||
2051 | /* 'fill_super()' opens ubi again so we must close it here */ | 2051 | /* 'fill_super()' opens ubi again so we must close it here */ |
2052 | ubi_close_volume(ubi); | 2052 | ubi_close_volume(ubi); |
2053 | 2053 | ||
2054 | return simple_set_mnt(mnt, sb); | 2054 | simple_set_mnt(mnt, sb); |
2055 | return 0; | ||
2055 | 2056 | ||
2056 | out_deact: | 2057 | out_deact: |
2057 | up_write(&sb->s_umount); | 2058 | up_write(&sb->s_umount); |