Skip to contentSkip to conversation

UBIFS: fixes for 3.6-rcX

PATCH New Artem Bityutskiy 1 participant 4 messages Aug 21, 2012

Subsystems (2)
lore
Share & tools
lore
#1 lore raw

PATCH 1/3 UBIFS: remove stale commentary

In reply to Artem Bityutskiy

From: Artem Bityutskiy <[email protected]>

---
 fs/ubifs/super.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
fs/ubifs/super.c +0 -3
index c3fa6c5..71a197f 100644
@@ -1157,9 +1157,6 @@ static int check_free_space(struct ubifs_info *c)
  *
  * This function mounts UBIFS file system. Returns zero in case of success and
  * a negative error code in case of failure.
- *
- * Note, the function does not de-allocate resources it it fails half way
- * through, and the caller has to do this instead.
  */
 static int mount_ubifs(struct ubifs_info *c)
 {
Signature · 1 line
1.7.7.6
#2 lore raw

PATCH 2/3 UBIFS: fix error error path

In reply to Artem Bityutskiy

From: Artem Bityutskiy <[email protected]>

This patch fixes a regression introduced by
"4994297 UBIFS: make ubifs_lpt_init clean-up in case of failure" which I've hit while running the 'integck -p' test. When remount the file-system from R/O mode to R/W mode and 'lpt_init_wr()' fails, we free _all_ LPT resources by calling 'ubifs_lpt_free(c, 0)', even those needed for R/O mode. This leads to subsequent crashes, e.g., if we try to unmount the file-system.

---
 fs/ubifs/lpt.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
fs/ubifs/lpt.c +4 -1
index ce33b2b..8640920 100644
@@ -1749,7 +1749,10 @@ int ubifs_lpt_init(struct ubifs_info *c, int rd, int wr)
 	return 0;
 
 out_err:
-	ubifs_lpt_free(c, 0);
+	if (wr)
+		ubifs_lpt_free(c, 1);
+	if (rd)
+		ubifs_lpt_free(c, 0);
 	return err;
 }
 
Signature · 1 line
1.7.7.6
#0 lore raw

cover UBIFS: fixes for 3.6-rcX

Hi,

I am going to send these fixes to 3.6-rcX. They fix UBIFS regression reported by Uwe, and an error-path bug which I hit while testing a fix for Uwe using 'integck' + power cut emulation.

Uwe, would you please provide your Tested-by and probably Reviewed-by?

Artem.

#3 lore raw

PATCH 3/3 UBIFS: fix replay regression

From: Artem Bityutskiy <[email protected]>

Commit "d51f17e UBIFS: simplify reply code a bit" introduces a bug with the following symptoms:

UBIFS error (pid 1): replay_log_leb: first CS node at LEB 3:0 has wrong commit number 0 expected 1

The issue is that we start replaying the log from UBIFS_LOG_LNUM instead of c->lhead_lnum. This patch fixes that.

---
 fs/ubifs/replay.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
fs/ubifs/replay.c +1 -2
index eba46d4..94d78fc 100644
@@ -1026,7 +1026,6 @@ int ubifs_replay_journal(struct ubifs_info *c)
 	c->replaying = 1;
 	lnum = c->ltail_lnum = c->lhead_lnum;
 
-	lnum = UBIFS_LOG_LNUM;
 	do {
 		err = replay_log_leb(c, lnum, 0, c->sbuf);
 		if (err == 1)
@@ -1035,7 +1034,7 @@ int ubifs_replay_journal(struct ubifs_info *c)
 		if (err)
 			goto out;
 		lnum = ubifs_next_log_lnum(c, lnum);
-	} while (lnum != UBIFS_LOG_LNUM);
+	} while (lnum != c->ltail_lnum);
 
 	err = replay_buds(c);
 	if (err)
Signature · 1 line
1.7.7.6