diff options
Diffstat (limited to 'fs/ubifs')
-rw-r--r-- | fs/ubifs/Kconfig | 9 | ||||
-rw-r--r-- | fs/ubifs/debug.c | 2 | ||||
-rw-r--r-- | fs/ubifs/file.c | 11 | ||||
-rw-r--r-- | fs/ubifs/ioctl.c | 2 | ||||
-rw-r--r-- | fs/ubifs/lprops.c | 2 | ||||
-rw-r--r-- | fs/ubifs/lpt_commit.c | 4 | ||||
-rw-r--r-- | fs/ubifs/orphan.c | 2 | ||||
-rw-r--r-- | fs/ubifs/super.c | 1 |
8 files changed, 13 insertions, 20 deletions
diff --git a/fs/ubifs/Kconfig b/fs/ubifs/Kconfig index 1d1859dc3de5..d7440904be17 100644 --- a/fs/ubifs/Kconfig +++ b/fs/ubifs/Kconfig | |||
@@ -58,12 +58,3 @@ config UBIFS_FS_DEBUG | |||
58 | down UBIFS. You can then further enable / disable individual debugging | 58 | down UBIFS. You can then further enable / disable individual debugging |
59 | features using UBIFS module parameters and the corresponding sysfs | 59 | features using UBIFS module parameters and the corresponding sysfs |
60 | interfaces. | 60 | interfaces. |
61 | |||
62 | config UBIFS_FS_DEBUG_CHKS | ||
63 | bool "Enable extra checks" | ||
64 | depends on UBIFS_FS_DEBUG | ||
65 | help | ||
66 | If extra checks are enabled UBIFS will check the consistency of its | ||
67 | internal data structures during operation. However, UBIFS performance | ||
68 | is dramatically slower when this option is selected especially if the | ||
69 | file system is large. | ||
diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c index 01c2b028e525..f25a7339f800 100644 --- a/fs/ubifs/debug.c +++ b/fs/ubifs/debug.c | |||
@@ -818,7 +818,7 @@ void dbg_dump_leb(const struct ubifs_info *c, int lnum) | |||
818 | printk(KERN_DEBUG "(pid %d) start dumping LEB %d\n", | 818 | printk(KERN_DEBUG "(pid %d) start dumping LEB %d\n", |
819 | current->pid, lnum); | 819 | current->pid, lnum); |
820 | 820 | ||
821 | buf = __vmalloc(c->leb_size, GFP_KERNEL | GFP_NOFS, PAGE_KERNEL); | 821 | buf = __vmalloc(c->leb_size, GFP_NOFS, PAGE_KERNEL); |
822 | if (!buf) { | 822 | if (!buf) { |
823 | ubifs_err("cannot allocate memory for dumping LEB %d", lnum); | 823 | ubifs_err("cannot allocate memory for dumping LEB %d", lnum); |
824 | return; | 824 | return; |
diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c index d77db7e36484..28be1e6a65e8 100644 --- a/fs/ubifs/file.c +++ b/fs/ubifs/file.c | |||
@@ -448,10 +448,12 @@ static int ubifs_write_begin(struct file *file, struct address_space *mapping, | |||
448 | if (!(pos & ~PAGE_CACHE_MASK) && len == PAGE_CACHE_SIZE) { | 448 | if (!(pos & ~PAGE_CACHE_MASK) && len == PAGE_CACHE_SIZE) { |
449 | /* | 449 | /* |
450 | * We change whole page so no need to load it. But we | 450 | * We change whole page so no need to load it. But we |
451 | * have to set the @PG_checked flag to make the further | 451 | * do not know whether this page exists on the media or |
452 | * code know that the page is new. This might be not | 452 | * not, so we assume the latter because it requires |
453 | * true, but it is better to budget more than to read | 453 | * larger budget. The assumption is that it is better |
454 | * the page from the media. | 454 | * to budget a bit more than to read the page from the |
455 | * media. Thus, we are setting the @PG_checked flag | ||
456 | * here. | ||
455 | */ | 457 | */ |
456 | SetPageChecked(page); | 458 | SetPageChecked(page); |
457 | skipped_read = 1; | 459 | skipped_read = 1; |
@@ -559,6 +561,7 @@ static int ubifs_write_end(struct file *file, struct address_space *mapping, | |||
559 | dbg_gen("copied %d instead of %d, read page and repeat", | 561 | dbg_gen("copied %d instead of %d, read page and repeat", |
560 | copied, len); | 562 | copied, len); |
561 | cancel_budget(c, page, ui, appending); | 563 | cancel_budget(c, page, ui, appending); |
564 | ClearPageChecked(page); | ||
562 | 565 | ||
563 | /* | 566 | /* |
564 | * Return 0 to force VFS to repeat the whole operation, or the | 567 | * Return 0 to force VFS to repeat the whole operation, or the |
diff --git a/fs/ubifs/ioctl.c b/fs/ubifs/ioctl.c index 8aacd64957a2..548acf494afd 100644 --- a/fs/ubifs/ioctl.c +++ b/fs/ubifs/ioctl.c | |||
@@ -160,7 +160,7 @@ long ubifs_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
160 | if (IS_RDONLY(inode)) | 160 | if (IS_RDONLY(inode)) |
161 | return -EROFS; | 161 | return -EROFS; |
162 | 162 | ||
163 | if (!is_owner_or_cap(inode)) | 163 | if (!inode_owner_or_capable(inode)) |
164 | return -EACCES; | 164 | return -EACCES; |
165 | 165 | ||
166 | if (get_user(flags, (int __user *) arg)) | 166 | if (get_user(flags, (int __user *) arg)) |
diff --git a/fs/ubifs/lprops.c b/fs/ubifs/lprops.c index c7b25e2f7764..0ee0847f2421 100644 --- a/fs/ubifs/lprops.c +++ b/fs/ubifs/lprops.c | |||
@@ -1094,7 +1094,7 @@ static int scan_check_cb(struct ubifs_info *c, | |||
1094 | } | 1094 | } |
1095 | } | 1095 | } |
1096 | 1096 | ||
1097 | buf = __vmalloc(c->leb_size, GFP_KERNEL | GFP_NOFS, PAGE_KERNEL); | 1097 | buf = __vmalloc(c->leb_size, GFP_NOFS, PAGE_KERNEL); |
1098 | if (!buf) { | 1098 | if (!buf) { |
1099 | ubifs_err("cannot allocate memory to scan LEB %d", lnum); | 1099 | ubifs_err("cannot allocate memory to scan LEB %d", lnum); |
1100 | goto out; | 1100 | goto out; |
diff --git a/fs/ubifs/lpt_commit.c b/fs/ubifs/lpt_commit.c index 0a3c2c3f5c4a..0c9c69bd983a 100644 --- a/fs/ubifs/lpt_commit.c +++ b/fs/ubifs/lpt_commit.c | |||
@@ -1633,7 +1633,7 @@ static int dbg_check_ltab_lnum(struct ubifs_info *c, int lnum) | |||
1633 | if (!(ubifs_chk_flags & UBIFS_CHK_LPROPS)) | 1633 | if (!(ubifs_chk_flags & UBIFS_CHK_LPROPS)) |
1634 | return 0; | 1634 | return 0; |
1635 | 1635 | ||
1636 | buf = p = __vmalloc(c->leb_size, GFP_KERNEL | GFP_NOFS, PAGE_KERNEL); | 1636 | buf = p = __vmalloc(c->leb_size, GFP_NOFS, PAGE_KERNEL); |
1637 | if (!buf) { | 1637 | if (!buf) { |
1638 | ubifs_err("cannot allocate memory for ltab checking"); | 1638 | ubifs_err("cannot allocate memory for ltab checking"); |
1639 | return 0; | 1639 | return 0; |
@@ -1885,7 +1885,7 @@ static void dump_lpt_leb(const struct ubifs_info *c, int lnum) | |||
1885 | 1885 | ||
1886 | printk(KERN_DEBUG "(pid %d) start dumping LEB %d\n", | 1886 | printk(KERN_DEBUG "(pid %d) start dumping LEB %d\n", |
1887 | current->pid, lnum); | 1887 | current->pid, lnum); |
1888 | buf = p = __vmalloc(c->leb_size, GFP_KERNEL | GFP_NOFS, PAGE_KERNEL); | 1888 | buf = p = __vmalloc(c->leb_size, GFP_NOFS, PAGE_KERNEL); |
1889 | if (!buf) { | 1889 | if (!buf) { |
1890 | ubifs_err("cannot allocate memory to dump LPT"); | 1890 | ubifs_err("cannot allocate memory to dump LPT"); |
1891 | return; | 1891 | return; |
diff --git a/fs/ubifs/orphan.c b/fs/ubifs/orphan.c index 2cdbd31641d7..09df318e368f 100644 --- a/fs/ubifs/orphan.c +++ b/fs/ubifs/orphan.c | |||
@@ -898,7 +898,7 @@ static int dbg_scan_orphans(struct ubifs_info *c, struct check_info *ci) | |||
898 | if (c->no_orphs) | 898 | if (c->no_orphs) |
899 | return 0; | 899 | return 0; |
900 | 900 | ||
901 | buf = __vmalloc(c->leb_size, GFP_KERNEL | GFP_NOFS, PAGE_KERNEL); | 901 | buf = __vmalloc(c->leb_size, GFP_NOFS, PAGE_KERNEL); |
902 | if (!buf) { | 902 | if (!buf) { |
903 | ubifs_err("cannot allocate memory to check orphans"); | 903 | ubifs_err("cannot allocate memory to check orphans"); |
904 | return 0; | 904 | return 0; |
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index e5dc1e120e8d..6ddd9973e681 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c | |||
@@ -2011,7 +2011,6 @@ static int ubifs_fill_super(struct super_block *sb, void *data, int silent) | |||
2011 | */ | 2011 | */ |
2012 | c->bdi.name = "ubifs", | 2012 | c->bdi.name = "ubifs", |
2013 | c->bdi.capabilities = BDI_CAP_MAP_COPY; | 2013 | c->bdi.capabilities = BDI_CAP_MAP_COPY; |
2014 | c->bdi.unplug_io_fn = default_unplug_io_fn; | ||
2015 | err = bdi_init(&c->bdi); | 2014 | err = bdi_init(&c->bdi); |
2016 | if (err) | 2015 | if (err) |
2017 | goto out_close; | 2016 | goto out_close; |