All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] UBIFS: fixes for 3.6-rcX
@ 2012-08-21 11:05 Artem Bityutskiy
  2012-08-21 11:05 ` [PATCH 1/3] UBIFS: remove stale commentary Artem Bityutskiy
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Artem Bityutskiy @ 2012-08-21 11:05 UTC (permalink / raw)
  To: MTD Maling List, Uwe Kleine-König

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/3] UBIFS: remove stale commentary
  2012-08-21 11:05 [PATCH 0/3] UBIFS: fixes for 3.6-rcX Artem Bityutskiy
@ 2012-08-21 11:05 ` Artem Bityutskiy
  2012-08-21 11:05 ` [PATCH 2/3] UBIFS: fix error error path Artem Bityutskiy
  2012-08-21 11:06 ` [PATCH 3/3] UBIFS: fix replay regression Artem Bityutskiy
  2 siblings, 0 replies; 4+ messages in thread
From: Artem Bityutskiy @ 2012-08-21 11:05 UTC (permalink / raw)
  To: MTD Maling List, Uwe Kleine-König

From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
---
 fs/ubifs/super.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index c3fa6c5..71a197f 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -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)
 {
-- 
1.7.7.6

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] UBIFS: fix error error path
  2012-08-21 11:05 [PATCH 0/3] UBIFS: fixes for 3.6-rcX Artem Bityutskiy
  2012-08-21 11:05 ` [PATCH 1/3] UBIFS: remove stale commentary Artem Bityutskiy
@ 2012-08-21 11:05 ` Artem Bityutskiy
  2012-08-21 11:06 ` [PATCH 3/3] UBIFS: fix replay regression Artem Bityutskiy
  2 siblings, 0 replies; 4+ messages in thread
From: Artem Bityutskiy @ 2012-08-21 11:05 UTC (permalink / raw)
  To: MTD Maling List, Uwe Kleine-König

From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>

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.

Cc: stable@vger.kernel.org [v3.5+]
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
---
 fs/ubifs/lpt.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/fs/ubifs/lpt.c b/fs/ubifs/lpt.c
index ce33b2b..8640920 100644
--- a/fs/ubifs/lpt.c
+++ b/fs/ubifs/lpt.c
@@ -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;
 }
 
-- 
1.7.7.6

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] UBIFS: fix replay regression
  2012-08-21 11:05 [PATCH 0/3] UBIFS: fixes for 3.6-rcX Artem Bityutskiy
  2012-08-21 11:05 ` [PATCH 1/3] UBIFS: remove stale commentary Artem Bityutskiy
  2012-08-21 11:05 ` [PATCH 2/3] UBIFS: fix error error path Artem Bityutskiy
@ 2012-08-21 11:06 ` Artem Bityutskiy
  2 siblings, 0 replies; 4+ messages in thread
From: Artem Bityutskiy @ 2012-08-21 11:06 UTC (permalink / raw)
  To: MTD Maling List, Uwe Kleine-König

From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>

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.

Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
---
 fs/ubifs/replay.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/fs/ubifs/replay.c b/fs/ubifs/replay.c
index eba46d4..94d78fc 100644
--- a/fs/ubifs/replay.c
+++ b/fs/ubifs/replay.c
@@ -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)
-- 
1.7.7.6

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-08-21 11:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-21 11:05 [PATCH 0/3] UBIFS: fixes for 3.6-rcX Artem Bityutskiy
2012-08-21 11:05 ` [PATCH 1/3] UBIFS: remove stale commentary Artem Bityutskiy
2012-08-21 11:05 ` [PATCH 2/3] UBIFS: fix error error path Artem Bityutskiy
2012-08-21 11:06 ` [PATCH 3/3] UBIFS: fix replay regression Artem Bityutskiy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.