diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-06 18:00:19 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-06 18:00:19 -0400 |
commit | e0724bf6e4a1f2e678d2b2aab01cae22e17862f0 (patch) | |
tree | 559a8fa8e7a92f8ae0e0a27d4e71f408fa7cec62 /fs/ubifs/super.c | |
parent | 38d9aefb5ce8f26358b0d5cd933cfa9e267105b1 (diff) | |
parent | de0975781a1a8bc92e07eb7681d10ef9bb5e6df9 (diff) |
Merge branch 'linux-next' of git://git.infradead.org/ubifs-2.6
* 'linux-next' of git://git.infradead.org/ubifs-2.6:
UBIFS: fix recovery bug
UBIFS: add R/O compatibility
UBIFS: fix compiler warnings
UBIFS: fully sort GCed nodes
UBIFS: fix commentaries
UBIFS: introduce a helpful variable
UBIFS: use KERN_CONT
UBIFS: fix lprops committing bug
UBIFS: fix bogus assertion
UBIFS: fix bug where page is marked uptodate when out of space
UBIFS: amend key_hash return value
UBIFS: improve find function interface
UBIFS: list usage cleanup
UBIFS: fix dbg_chk_lpt_sz()
Diffstat (limited to 'fs/ubifs/super.c')
-rw-r--r-- | fs/ubifs/super.c | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index c5c98355459a..faa44f90608a 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c | |||
@@ -421,8 +421,8 @@ static int ubifs_show_options(struct seq_file *s, struct vfsmount *mnt) | |||
421 | seq_printf(s, ",no_chk_data_crc"); | 421 | seq_printf(s, ",no_chk_data_crc"); |
422 | 422 | ||
423 | if (c->mount_opts.override_compr) { | 423 | if (c->mount_opts.override_compr) { |
424 | seq_printf(s, ",compr="); | 424 | seq_printf(s, ",compr=%s", |
425 | seq_printf(s, ubifs_compr_name(c->mount_opts.compr_type)); | 425 | ubifs_compr_name(c->mount_opts.compr_type)); |
426 | } | 426 | } |
427 | 427 | ||
428 | return 0; | 428 | return 0; |
@@ -700,6 +700,8 @@ static int init_constants_sb(struct ubifs_info *c) | |||
700 | if (err) | 700 | if (err) |
701 | return err; | 701 | return err; |
702 | 702 | ||
703 | /* Initialize effective LEB size used in budgeting calculations */ | ||
704 | c->idx_leb_size = c->leb_size - c->max_idx_node_sz; | ||
703 | return 0; | 705 | return 0; |
704 | } | 706 | } |
705 | 707 | ||
@@ -716,6 +718,7 @@ static void init_constants_master(struct ubifs_info *c) | |||
716 | long long tmp64; | 718 | long long tmp64; |
717 | 719 | ||
718 | c->min_idx_lebs = ubifs_calc_min_idx_lebs(c); | 720 | c->min_idx_lebs = ubifs_calc_min_idx_lebs(c); |
721 | c->report_rp_size = ubifs_reported_space(c, c->rp_size); | ||
719 | 722 | ||
720 | /* | 723 | /* |
721 | * Calculate total amount of FS blocks. This number is not used | 724 | * Calculate total amount of FS blocks. This number is not used |
@@ -1201,7 +1204,7 @@ static int mount_ubifs(struct ubifs_info *c) | |||
1201 | goto out_cbuf; | 1204 | goto out_cbuf; |
1202 | 1205 | ||
1203 | /* Create background thread */ | 1206 | /* Create background thread */ |
1204 | c->bgt = kthread_create(ubifs_bg_thread, c, c->bgt_name); | 1207 | c->bgt = kthread_create(ubifs_bg_thread, c, "%s", c->bgt_name); |
1205 | if (IS_ERR(c->bgt)) { | 1208 | if (IS_ERR(c->bgt)) { |
1206 | err = PTR_ERR(c->bgt); | 1209 | err = PTR_ERR(c->bgt); |
1207 | c->bgt = NULL; | 1210 | c->bgt = NULL; |
@@ -1318,11 +1321,15 @@ static int mount_ubifs(struct ubifs_info *c) | |||
1318 | else { | 1321 | else { |
1319 | c->need_recovery = 0; | 1322 | c->need_recovery = 0; |
1320 | ubifs_msg("recovery completed"); | 1323 | ubifs_msg("recovery completed"); |
1321 | /* GC LEB has to be empty and taken at this point */ | 1324 | /* |
1322 | ubifs_assert(c->lst.taken_empty_lebs == 1); | 1325 | * GC LEB has to be empty and taken at this point. But |
1326 | * the journal head LEBs may also be accounted as | ||
1327 | * "empty taken" if they are empty. | ||
1328 | */ | ||
1329 | ubifs_assert(c->lst.taken_empty_lebs > 0); | ||
1323 | } | 1330 | } |
1324 | } else | 1331 | } else |
1325 | ubifs_assert(c->lst.taken_empty_lebs == 1); | 1332 | ubifs_assert(c->lst.taken_empty_lebs > 0); |
1326 | 1333 | ||
1327 | err = dbg_check_filesystem(c); | 1334 | err = dbg_check_filesystem(c); |
1328 | if (err) | 1335 | if (err) |
@@ -1344,8 +1351,9 @@ static int mount_ubifs(struct ubifs_info *c) | |||
1344 | x = (long long)c->log_lebs * c->leb_size + c->max_bud_bytes; | 1351 | x = (long long)c->log_lebs * c->leb_size + c->max_bud_bytes; |
1345 | ubifs_msg("journal size: %lld bytes (%lld KiB, %lld MiB, %d " | 1352 | ubifs_msg("journal size: %lld bytes (%lld KiB, %lld MiB, %d " |
1346 | "LEBs)", x, x >> 10, x >> 20, c->log_lebs + c->max_bud_cnt); | 1353 | "LEBs)", x, x >> 10, x >> 20, c->log_lebs + c->max_bud_cnt); |
1347 | ubifs_msg("media format: %d (latest is %d)", | 1354 | ubifs_msg("media format: w%d/r%d (latest is w%d/r%d)", |
1348 | c->fmt_version, UBIFS_FORMAT_VERSION); | 1355 | c->fmt_version, c->ro_compat_version, |
1356 | UBIFS_FORMAT_VERSION, UBIFS_RO_COMPAT_VERSION); | ||
1349 | ubifs_msg("default compressor: %s", ubifs_compr_name(c->default_compr)); | 1357 | ubifs_msg("default compressor: %s", ubifs_compr_name(c->default_compr)); |
1350 | ubifs_msg("reserved for root: %llu bytes (%llu KiB)", | 1358 | ubifs_msg("reserved for root: %llu bytes (%llu KiB)", |
1351 | c->report_rp_size, c->report_rp_size >> 10); | 1359 | c->report_rp_size, c->report_rp_size >> 10); |
@@ -1485,6 +1493,15 @@ static int ubifs_remount_rw(struct ubifs_info *c) | |||
1485 | { | 1493 | { |
1486 | int err, lnum; | 1494 | int err, lnum; |
1487 | 1495 | ||
1496 | if (c->rw_incompat) { | ||
1497 | ubifs_err("the file-system is not R/W-compatible"); | ||
1498 | ubifs_msg("on-flash format version is w%d/r%d, but software " | ||
1499 | "only supports up to version w%d/r%d", c->fmt_version, | ||
1500 | c->ro_compat_version, UBIFS_FORMAT_VERSION, | ||
1501 | UBIFS_RO_COMPAT_VERSION); | ||
1502 | return -EROFS; | ||
1503 | } | ||
1504 | |||
1488 | mutex_lock(&c->umount_mutex); | 1505 | mutex_lock(&c->umount_mutex); |
1489 | dbg_save_space_info(c); | 1506 | dbg_save_space_info(c); |
1490 | c->remounting_rw = 1; | 1507 | c->remounting_rw = 1; |
@@ -1554,7 +1571,7 @@ static int ubifs_remount_rw(struct ubifs_info *c) | |||
1554 | ubifs_create_buds_lists(c); | 1571 | ubifs_create_buds_lists(c); |
1555 | 1572 | ||
1556 | /* Create background thread */ | 1573 | /* Create background thread */ |
1557 | c->bgt = kthread_create(ubifs_bg_thread, c, c->bgt_name); | 1574 | c->bgt = kthread_create(ubifs_bg_thread, c, "%s", c->bgt_name); |
1558 | if (IS_ERR(c->bgt)) { | 1575 | if (IS_ERR(c->bgt)) { |
1559 | err = PTR_ERR(c->bgt); | 1576 | err = PTR_ERR(c->bgt); |
1560 | c->bgt = NULL; | 1577 | c->bgt = NULL; |
@@ -1775,7 +1792,7 @@ static int ubifs_remount_fs(struct super_block *sb, int *flags, char *data) | |||
1775 | c->bu.buf = NULL; | 1792 | c->bu.buf = NULL; |
1776 | } | 1793 | } |
1777 | 1794 | ||
1778 | ubifs_assert(c->lst.taken_empty_lebs == 1); | 1795 | ubifs_assert(c->lst.taken_empty_lebs > 0); |
1779 | return 0; | 1796 | return 0; |
1780 | } | 1797 | } |
1781 | 1798 | ||