diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-15 16:43:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-15 16:43:40 -0400 |
commit | d613896926be608796bb80454256a07b55fe0e87 (patch) | |
tree | e741ea9477e013a319d3dedceb0aea66c8c3606d /fs/ubifs/replay.c | |
parent | fa927894bbb4a4c7669c72bad1924991022fda38 (diff) | |
parent | 502690674281a047abd45f81e64c498bc23a8bb3 (diff) |
Merge tag 'upstream-4.1-rc1' of git://git.infradead.org/linux-ubifs
Pull UBI/UBIFS updates from Richard Weinberger:
"This pull request includes the following UBI/UBIFS changes:
- powercut emulation for UBI
- a huge update to UBI Fastmap
- cleanups and bugfixes all over UBI and UBIFS"
* tag 'upstream-4.1-rc1' of git://git.infradead.org/linux-ubifs: (50 commits)
UBI: power cut emulation for testing
UBIFS: fix output format of INUM_WATERMARK
UBI: Fastmap: Fall back to scanning mode after ECC error
UBI: Fastmap: Remove is_fm_block()
UBI: Fastmap: Add blank line after declarations
UBI: Fastmap: Remove else after return.
UBI: Fastmap: Introduce may_reserve_for_fm()
UBI: Fastmap: Introduce ubi_fastmap_init()
UBI: Fastmap: Wire up WL accessor functions
UBI: Add accessor functions for WL data structures
UBI: Move fastmap specific functions out of wl.c
UBI: Fastmap: Add new module parameter fm_debug
UBI: Fastmap: Make self_check_eba() depend on fastmap self checking
UBI: Fastmap: Add self check to detect absent PEBs
UBI: Fix stale pointers in ubi->lookuptbl
UBI: Fastmap: Enhance fastmap checking
UBI: Add initial support for fastmap self checks
UBI: Fastmap: Rework fastmap error paths
UBI: Fastmap: Prepare for variable sized fastmaps
UBI: Fastmap: Locking updates
...
Diffstat (limited to 'fs/ubifs/replay.c')
-rw-r--r-- | fs/ubifs/replay.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/fs/ubifs/replay.c b/fs/ubifs/replay.c index 9b40a1c5e160..3ca4540130b5 100644 --- a/fs/ubifs/replay.c +++ b/fs/ubifs/replay.c | |||
@@ -458,13 +458,13 @@ int ubifs_validate_entry(struct ubifs_info *c, | |||
458 | nlen > UBIFS_MAX_NLEN || dent->name[nlen] != 0 || | 458 | nlen > UBIFS_MAX_NLEN || dent->name[nlen] != 0 || |
459 | strnlen(dent->name, nlen) != nlen || | 459 | strnlen(dent->name, nlen) != nlen || |
460 | le64_to_cpu(dent->inum) > MAX_INUM) { | 460 | le64_to_cpu(dent->inum) > MAX_INUM) { |
461 | ubifs_err("bad %s node", key_type == UBIFS_DENT_KEY ? | 461 | ubifs_err(c, "bad %s node", key_type == UBIFS_DENT_KEY ? |
462 | "directory entry" : "extended attribute entry"); | 462 | "directory entry" : "extended attribute entry"); |
463 | return -EINVAL; | 463 | return -EINVAL; |
464 | } | 464 | } |
465 | 465 | ||
466 | if (key_type != UBIFS_DENT_KEY && key_type != UBIFS_XENT_KEY) { | 466 | if (key_type != UBIFS_DENT_KEY && key_type != UBIFS_XENT_KEY) { |
467 | ubifs_err("bad key type %d", key_type); | 467 | ubifs_err(c, "bad key type %d", key_type); |
468 | return -EINVAL; | 468 | return -EINVAL; |
469 | } | 469 | } |
470 | 470 | ||
@@ -589,7 +589,7 @@ static int replay_bud(struct ubifs_info *c, struct bud_entry *b) | |||
589 | cond_resched(); | 589 | cond_resched(); |
590 | 590 | ||
591 | if (snod->sqnum >= SQNUM_WATERMARK) { | 591 | if (snod->sqnum >= SQNUM_WATERMARK) { |
592 | ubifs_err("file system's life ended"); | 592 | ubifs_err(c, "file system's life ended"); |
593 | goto out_dump; | 593 | goto out_dump; |
594 | } | 594 | } |
595 | 595 | ||
@@ -647,7 +647,7 @@ static int replay_bud(struct ubifs_info *c, struct bud_entry *b) | |||
647 | if (old_size < 0 || old_size > c->max_inode_sz || | 647 | if (old_size < 0 || old_size > c->max_inode_sz || |
648 | new_size < 0 || new_size > c->max_inode_sz || | 648 | new_size < 0 || new_size > c->max_inode_sz || |
649 | old_size <= new_size) { | 649 | old_size <= new_size) { |
650 | ubifs_err("bad truncation node"); | 650 | ubifs_err(c, "bad truncation node"); |
651 | goto out_dump; | 651 | goto out_dump; |
652 | } | 652 | } |
653 | 653 | ||
@@ -662,7 +662,7 @@ static int replay_bud(struct ubifs_info *c, struct bud_entry *b) | |||
662 | break; | 662 | break; |
663 | } | 663 | } |
664 | default: | 664 | default: |
665 | ubifs_err("unexpected node type %d in bud LEB %d:%d", | 665 | ubifs_err(c, "unexpected node type %d in bud LEB %d:%d", |
666 | snod->type, lnum, snod->offs); | 666 | snod->type, lnum, snod->offs); |
667 | err = -EINVAL; | 667 | err = -EINVAL; |
668 | goto out_dump; | 668 | goto out_dump; |
@@ -685,7 +685,7 @@ out: | |||
685 | return err; | 685 | return err; |
686 | 686 | ||
687 | out_dump: | 687 | out_dump: |
688 | ubifs_err("bad node is at LEB %d:%d", lnum, snod->offs); | 688 | ubifs_err(c, "bad node is at LEB %d:%d", lnum, snod->offs); |
689 | ubifs_dump_node(c, snod->node); | 689 | ubifs_dump_node(c, snod->node); |
690 | ubifs_scan_destroy(sleb); | 690 | ubifs_scan_destroy(sleb); |
691 | return -EINVAL; | 691 | return -EINVAL; |
@@ -805,7 +805,7 @@ static int validate_ref(struct ubifs_info *c, const struct ubifs_ref_node *ref) | |||
805 | if (bud) { | 805 | if (bud) { |
806 | if (bud->jhead == jhead && bud->start <= offs) | 806 | if (bud->jhead == jhead && bud->start <= offs) |
807 | return 1; | 807 | return 1; |
808 | ubifs_err("bud at LEB %d:%d was already referred", lnum, offs); | 808 | ubifs_err(c, "bud at LEB %d:%d was already referred", lnum, offs); |
809 | return -EINVAL; | 809 | return -EINVAL; |
810 | } | 810 | } |
811 | 811 | ||
@@ -861,12 +861,12 @@ static int replay_log_leb(struct ubifs_info *c, int lnum, int offs, void *sbuf) | |||
861 | * numbers. | 861 | * numbers. |
862 | */ | 862 | */ |
863 | if (snod->type != UBIFS_CS_NODE) { | 863 | if (snod->type != UBIFS_CS_NODE) { |
864 | ubifs_err("first log node at LEB %d:%d is not CS node", | 864 | ubifs_err(c, "first log node at LEB %d:%d is not CS node", |
865 | lnum, offs); | 865 | lnum, offs); |
866 | goto out_dump; | 866 | goto out_dump; |
867 | } | 867 | } |
868 | if (le64_to_cpu(node->cmt_no) != c->cmt_no) { | 868 | if (le64_to_cpu(node->cmt_no) != c->cmt_no) { |
869 | ubifs_err("first CS node at LEB %d:%d has wrong commit number %llu expected %llu", | 869 | ubifs_err(c, "first CS node at LEB %d:%d has wrong commit number %llu expected %llu", |
870 | lnum, offs, | 870 | lnum, offs, |
871 | (unsigned long long)le64_to_cpu(node->cmt_no), | 871 | (unsigned long long)le64_to_cpu(node->cmt_no), |
872 | c->cmt_no); | 872 | c->cmt_no); |
@@ -891,7 +891,7 @@ static int replay_log_leb(struct ubifs_info *c, int lnum, int offs, void *sbuf) | |||
891 | 891 | ||
892 | /* Make sure the first node sits at offset zero of the LEB */ | 892 | /* Make sure the first node sits at offset zero of the LEB */ |
893 | if (snod->offs != 0) { | 893 | if (snod->offs != 0) { |
894 | ubifs_err("first node is not at zero offset"); | 894 | ubifs_err(c, "first node is not at zero offset"); |
895 | goto out_dump; | 895 | goto out_dump; |
896 | } | 896 | } |
897 | 897 | ||
@@ -899,12 +899,12 @@ static int replay_log_leb(struct ubifs_info *c, int lnum, int offs, void *sbuf) | |||
899 | cond_resched(); | 899 | cond_resched(); |
900 | 900 | ||
901 | if (snod->sqnum >= SQNUM_WATERMARK) { | 901 | if (snod->sqnum >= SQNUM_WATERMARK) { |
902 | ubifs_err("file system's life ended"); | 902 | ubifs_err(c, "file system's life ended"); |
903 | goto out_dump; | 903 | goto out_dump; |
904 | } | 904 | } |
905 | 905 | ||
906 | if (snod->sqnum < c->cs_sqnum) { | 906 | if (snod->sqnum < c->cs_sqnum) { |
907 | ubifs_err("bad sqnum %llu, commit sqnum %llu", | 907 | ubifs_err(c, "bad sqnum %llu, commit sqnum %llu", |
908 | snod->sqnum, c->cs_sqnum); | 908 | snod->sqnum, c->cs_sqnum); |
909 | goto out_dump; | 909 | goto out_dump; |
910 | } | 910 | } |
@@ -934,12 +934,12 @@ static int replay_log_leb(struct ubifs_info *c, int lnum, int offs, void *sbuf) | |||
934 | case UBIFS_CS_NODE: | 934 | case UBIFS_CS_NODE: |
935 | /* Make sure it sits at the beginning of LEB */ | 935 | /* Make sure it sits at the beginning of LEB */ |
936 | if (snod->offs != 0) { | 936 | if (snod->offs != 0) { |
937 | ubifs_err("unexpected node in log"); | 937 | ubifs_err(c, "unexpected node in log"); |
938 | goto out_dump; | 938 | goto out_dump; |
939 | } | 939 | } |
940 | break; | 940 | break; |
941 | default: | 941 | default: |
942 | ubifs_err("unexpected node in log"); | 942 | ubifs_err(c, "unexpected node in log"); |
943 | goto out_dump; | 943 | goto out_dump; |
944 | } | 944 | } |
945 | } | 945 | } |
@@ -955,7 +955,7 @@ out: | |||
955 | return err; | 955 | return err; |
956 | 956 | ||
957 | out_dump: | 957 | out_dump: |
958 | ubifs_err("log error detected while replaying the log at LEB %d:%d", | 958 | ubifs_err(c, "log error detected while replaying the log at LEB %d:%d", |
959 | lnum, offs + snod->offs); | 959 | lnum, offs + snod->offs); |
960 | ubifs_dump_node(c, snod->node); | 960 | ubifs_dump_node(c, snod->node); |
961 | ubifs_scan_destroy(sleb); | 961 | ubifs_scan_destroy(sleb); |
@@ -1017,7 +1017,7 @@ int ubifs_replay_journal(struct ubifs_info *c) | |||
1017 | return free; /* Error code */ | 1017 | return free; /* Error code */ |
1018 | 1018 | ||
1019 | if (c->ihead_offs != c->leb_size - free) { | 1019 | if (c->ihead_offs != c->leb_size - free) { |
1020 | ubifs_err("bad index head LEB %d:%d", c->ihead_lnum, | 1020 | ubifs_err(c, "bad index head LEB %d:%d", c->ihead_lnum, |
1021 | c->ihead_offs); | 1021 | c->ihead_offs); |
1022 | return -EINVAL; | 1022 | return -EINVAL; |
1023 | } | 1023 | } |
@@ -1040,7 +1040,7 @@ int ubifs_replay_journal(struct ubifs_info *c) | |||
1040 | * someting went wrong and we cannot proceed mounting | 1040 | * someting went wrong and we cannot proceed mounting |
1041 | * the file-system. | 1041 | * the file-system. |
1042 | */ | 1042 | */ |
1043 | ubifs_err("no UBIFS nodes found at the log head LEB %d:%d, possibly corrupted", | 1043 | ubifs_err(c, "no UBIFS nodes found at the log head LEB %d:%d, possibly corrupted", |
1044 | lnum, 0); | 1044 | lnum, 0); |
1045 | err = -EINVAL; | 1045 | err = -EINVAL; |
1046 | } | 1046 | } |