diff options
| -rw-r--r-- | fs/ubifs/replay.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/fs/ubifs/replay.c b/fs/ubifs/replay.c index 21f7d047c306..ce42a7b0ca5a 100644 --- a/fs/ubifs/replay.c +++ b/fs/ubifs/replay.c | |||
| @@ -144,7 +144,7 @@ static int set_bud_lprops(struct ubifs_info *c, struct replay_entry *r) | |||
| 144 | /* | 144 | /* |
| 145 | * If the replay order was perfect the dirty space would now be | 145 | * If the replay order was perfect the dirty space would now be |
| 146 | * zero. The order is not perfect because the the journal heads | 146 | * zero. The order is not perfect because the the journal heads |
| 147 | * race with eachother. This is not a problem but is does mean | 147 | * race with each other. This is not a problem but is does mean |
| 148 | * that the dirty space may temporarily exceed c->leb_size | 148 | * that the dirty space may temporarily exceed c->leb_size |
| 149 | * during the replay. | 149 | * during the replay. |
| 150 | */ | 150 | */ |
| @@ -656,7 +656,7 @@ out_dump: | |||
| 656 | * @dirty: amount of dirty space from padding and deletion nodes | 656 | * @dirty: amount of dirty space from padding and deletion nodes |
| 657 | * | 657 | * |
| 658 | * This function inserts a reference node to the replay tree and returns zero | 658 | * This function inserts a reference node to the replay tree and returns zero |
| 659 | * in case of success ort a negative error code in case of failure. | 659 | * in case of success or a negative error code in case of failure. |
| 660 | */ | 660 | */ |
| 661 | static int insert_ref_node(struct ubifs_info *c, int lnum, int offs, | 661 | static int insert_ref_node(struct ubifs_info *c, int lnum, int offs, |
| 662 | unsigned long long sqnum, int free, int dirty) | 662 | unsigned long long sqnum, int free, int dirty) |
| @@ -883,7 +883,7 @@ static int replay_log_leb(struct ubifs_info *c, int lnum, int offs, void *sbuf) | |||
| 883 | * This means that we reached end of log and now | 883 | * This means that we reached end of log and now |
| 884 | * look to the older log data, which was already | 884 | * look to the older log data, which was already |
| 885 | * committed but the eraseblock was not erased (UBIFS | 885 | * committed but the eraseblock was not erased (UBIFS |
| 886 | * only unmaps it). So this basically means we have to | 886 | * only un-maps it). So this basically means we have to |
| 887 | * exit with "end of log" code. | 887 | * exit with "end of log" code. |
| 888 | */ | 888 | */ |
| 889 | err = 1; | 889 | err = 1; |
| @@ -1062,6 +1062,15 @@ int ubifs_replay_journal(struct ubifs_info *c) | |||
| 1062 | if (err) | 1062 | if (err) |
| 1063 | goto out; | 1063 | goto out; |
| 1064 | 1064 | ||
| 1065 | /* | ||
| 1066 | * UBIFS budgeting calculations use @c->budg_uncommitted_idx variable | ||
| 1067 | * to roughly estimate index growth. Things like @c->min_idx_lebs | ||
| 1068 | * depend on it. This means we have to initialize it to make sure | ||
| 1069 | * budgeting works properly. | ||
| 1070 | */ | ||
| 1071 | c->budg_uncommitted_idx = atomic_long_read(&c->dirty_zn_cnt); | ||
| 1072 | c->budg_uncommitted_idx *= c->max_idx_node_sz; | ||
| 1073 | |||
| 1065 | ubifs_assert(c->bud_bytes <= c->max_bud_bytes || c->need_recovery); | 1074 | ubifs_assert(c->bud_bytes <= c->max_bud_bytes || c->need_recovery); |
| 1066 | dbg_mnt("finished, log head LEB %d:%d, max_sqnum %llu, " | 1075 | dbg_mnt("finished, log head LEB %d:%d, max_sqnum %llu, " |
| 1067 | "highest_inum %lu", c->lhead_lnum, c->lhead_offs, c->max_sqnum, | 1076 | "highest_inum %lu", c->lhead_lnum, c->lhead_offs, c->max_sqnum, |
