linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* Re: [Resend PATCH 0/2] UBIFS: two trivial fix
  2015-09-23  9:11 [Resend PATCH 0/2] UBIFS: two trivial fix Sheng Yong
@ 2015-09-23  6:17 ` Richard Weinberger
  2015-09-23  6:45   ` Artem Bityutskiy
  2015-09-23  9:11 ` [Resend PATCH 1/2] UBIFS: call dbg_is_power_cut() instead of reading c->dbg->pc_happened Sheng Yong
  2015-09-23  9:11 ` [Resend PATCH 2/2] UBIFS: print verbose message when rescanning a corrupted node Sheng Yong
  2 siblings, 1 reply; 6+ messages in thread
From: Richard Weinberger @ 2015-09-23  6:17 UTC (permalink / raw)
  To: Sheng Yong, dedekind1; +Cc: linux-mtd

Am 23.09.2015 um 11:11 schrieb Sheng Yong:
> Sheng Yong (2):
>   UBIFS: call dbg_is_power_cut() instead of reading c->dbg->pc_happened
>   UBIFS: print verbose message when rescanning a corrupted node
> 
>  fs/ubifs/debug.c    | 8 ++++----
>  fs/ubifs/recovery.c | 2 +-
>  2 files changed, 5 insertions(+), 5 deletions(-)

Patches look good to me. :-)
Artem, I'd queue them for v4.4, ok?

Thanks,
//richard

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

* Re: [Resend PATCH 0/2] UBIFS: two trivial fix
  2015-09-23  6:17 ` Richard Weinberger
@ 2015-09-23  6:45   ` Artem Bityutskiy
  2015-10-03 18:41     ` Richard Weinberger
  0 siblings, 1 reply; 6+ messages in thread
From: Artem Bityutskiy @ 2015-09-23  6:45 UTC (permalink / raw)
  To: Richard Weinberger, Sheng Yong; +Cc: linux-mtd

On Wed, 2015-09-23 at 08:17 +0200, Richard Weinberger wrote:
> Am 23.09.2015 um 11:11 schrieb Sheng Yong:
> > Sheng Yong (2):
> >   UBIFS: call dbg_is_power_cut() instead of reading c->dbg
> > ->pc_happened
> >   UBIFS: print verbose message when rescanning a corrupted node
> > 
> >  fs/ubifs/debug.c    | 8 ++++----
> >  fs/ubifs/recovery.c | 2 +-
> >  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> Patches look good to me. :-)
> Artem, I'd queue them for v4.4, ok?

Yes, thanks,

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>

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

* [Resend PATCH 0/2] UBIFS: two trivial fix
@ 2015-09-23  9:11 Sheng Yong
  2015-09-23  6:17 ` Richard Weinberger
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Sheng Yong @ 2015-09-23  9:11 UTC (permalink / raw)
  To: dedekind1, richard.weinberger; +Cc: linux-mtd

Sheng Yong (2):
  UBIFS: call dbg_is_power_cut() instead of reading c->dbg->pc_happened
  UBIFS: print verbose message when rescanning a corrupted node

 fs/ubifs/debug.c    | 8 ++++----
 fs/ubifs/recovery.c | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

-- 
1.9.1

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

* [Resend PATCH 1/2] UBIFS: call dbg_is_power_cut() instead of reading c->dbg->pc_happened
  2015-09-23  9:11 [Resend PATCH 0/2] UBIFS: two trivial fix Sheng Yong
  2015-09-23  6:17 ` Richard Weinberger
@ 2015-09-23  9:11 ` Sheng Yong
  2015-09-23  9:11 ` [Resend PATCH 2/2] UBIFS: print verbose message when rescanning a corrupted node Sheng Yong
  2 siblings, 0 replies; 6+ messages in thread
From: Sheng Yong @ 2015-09-23  9:11 UTC (permalink / raw)
  To: dedekind1, richard.weinberger; +Cc: linux-mtd

Call dbg_is_power_cut() to emulate power cut instead of reading
c->dbg->pc_happened. Otherwise, the function becomes dead code.

Signed-off-by: Sheng Yong <shengyong1@huawei.com>
---
 fs/ubifs/debug.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c
index 4c46a98..595ca0d 100644
--- a/fs/ubifs/debug.c
+++ b/fs/ubifs/debug.c
@@ -2573,7 +2573,7 @@ int dbg_leb_write(struct ubifs_info *c, int lnum, const void *buf,
 {
 	int err, failing;
 
-	if (c->dbg->pc_happened)
+	if (dbg_is_power_cut(c))
 		return -EROFS;
 
 	failing = power_cut_emulated(c, lnum, 1);
@@ -2595,7 +2595,7 @@ int dbg_leb_change(struct ubifs_info *c, int lnum, const void *buf,
 {
 	int err;
 
-	if (c->dbg->pc_happened)
+	if (dbg_is_power_cut(c))
 		return -EROFS;
 	if (power_cut_emulated(c, lnum, 1))
 		return -EROFS;
@@ -2611,7 +2611,7 @@ int dbg_leb_unmap(struct ubifs_info *c, int lnum)
 {
 	int err;
 
-	if (c->dbg->pc_happened)
+	if (dbg_is_power_cut(c))
 		return -EROFS;
 	if (power_cut_emulated(c, lnum, 0))
 		return -EROFS;
@@ -2627,7 +2627,7 @@ int dbg_leb_map(struct ubifs_info *c, int lnum)
 {
 	int err;
 
-	if (c->dbg->pc_happened)
+	if (dbg_is_power_cut(c))
 		return -EROFS;
 	if (power_cut_emulated(c, lnum, 0))
 		return -EROFS;
-- 
1.9.1

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

* [Resend PATCH 2/2] UBIFS: print verbose message when rescanning a corrupted node
  2015-09-23  9:11 [Resend PATCH 0/2] UBIFS: two trivial fix Sheng Yong
  2015-09-23  6:17 ` Richard Weinberger
  2015-09-23  9:11 ` [Resend PATCH 1/2] UBIFS: call dbg_is_power_cut() instead of reading c->dbg->pc_happened Sheng Yong
@ 2015-09-23  9:11 ` Sheng Yong
  2 siblings, 0 replies; 6+ messages in thread
From: Sheng Yong @ 2015-09-23  9:11 UTC (permalink / raw)
  To: dedekind1, richard.weinberger; +Cc: linux-mtd

This is a trivial fix of showing verbose message when leb-recovery detects
a corrupted node, which is not the last one in the LEB. Rescan expects to
show more detail of the corrupted node.

Reviewed-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
---
 fs/ubifs/recovery.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ubifs/recovery.c b/fs/ubifs/recovery.c
index 695fc71..2a1f0bc 100644
--- a/fs/ubifs/recovery.c
+++ b/fs/ubifs/recovery.c
@@ -789,7 +789,7 @@ struct ubifs_scan_leb *ubifs_recover_leb(struct ubifs_info *c, int lnum,
 corrupted_rescan:
 	/* Re-scan the corrupted data with verbose messages */
 	ubifs_err(c, "corruption %d", ret);
-	ubifs_scan_a_node(c, buf, len, lnum, offs, 1);
+	ubifs_scan_a_node(c, buf, len, lnum, offs, 0);
 corrupted:
 	ubifs_scanned_corruption(c, lnum, offs, buf);
 	err = -EUCLEAN;
-- 
1.9.1

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

* Re: [Resend PATCH 0/2] UBIFS: two trivial fix
  2015-09-23  6:45   ` Artem Bityutskiy
@ 2015-10-03 18:41     ` Richard Weinberger
  0 siblings, 0 replies; 6+ messages in thread
From: Richard Weinberger @ 2015-10-03 18:41 UTC (permalink / raw)
  To: dedekind1, Sheng Yong; +Cc: linux-mtd

Am 23.09.2015 um 08:45 schrieb Artem Bityutskiy:
> On Wed, 2015-09-23 at 08:17 +0200, Richard Weinberger wrote:
>> Am 23.09.2015 um 11:11 schrieb Sheng Yong:
>>> Sheng Yong (2):
>>>   UBIFS: call dbg_is_power_cut() instead of reading c->dbg
>>> ->pc_happened
>>>   UBIFS: print verbose message when rescanning a corrupted node
>>>
>>>  fs/ubifs/debug.c    | 8 ++++----
>>>  fs/ubifs/recovery.c | 2 +-
>>>  2 files changed, 5 insertions(+), 5 deletions(-)
>>
>> Patches look good to me. :-)
>> Artem, I'd queue them for v4.4, ok?
> 
> Yes, thanks,
> 
> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>

Applied!

Thanks,
//richard

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

end of thread, other threads:[~2015-10-03 18:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-23  9:11 [Resend PATCH 0/2] UBIFS: two trivial fix Sheng Yong
2015-09-23  6:17 ` Richard Weinberger
2015-09-23  6:45   ` Artem Bityutskiy
2015-10-03 18:41     ` Richard Weinberger
2015-09-23  9:11 ` [Resend PATCH 1/2] UBIFS: call dbg_is_power_cut() instead of reading c->dbg->pc_happened Sheng Yong
2015-09-23  9:11 ` [Resend PATCH 2/2] UBIFS: print verbose message when rescanning a corrupted node Sheng Yong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).