Skip to contentSkip to conversation

ubifs: switch_gc_head: remove redondant sync of wbuf

PATCH In review Sylvain Etienne 4 participants 4 messages Jun 23, 2016 – Jun 27, 2016

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

PATCH 1/1 ubifs: switch_gc_head: remove redondant sync of wbuf

The wbuf is already sync-ed before ubifs_leb_unmap()

---

Notes:
This is my first patch on this mailing list. Please let me know if I missed something.

 fs/ubifs/gc.c | 4 ----
 1 file changed, 4 deletions(-)
fs/ubifs/gc.c +0 -4
index 9718da8..821b348 100644
@@ -100,10 +100,6 @@ static int switch_gc_head(struct ubifs_info *c)
 	if (err)
 		return err;
 
-	err = ubifs_wbuf_sync_nolock(wbuf);
-	if (err)
-		return err;
-
 	err = ubifs_add_bud_to_log(c, GCHD, gc_lnum, 0);
 	if (err)
 		return err;
Signature · 1 line
2.7.4
#1 lore raw

Am 23.06.2016 um 07:53 schrieb Sylvain Etienne:

Quoted 17 lines

The wbuf is already sync-ed before ubifs_leb_unmap()

---

Notes:
This is my first patch on this mailing list. Please let me know if I missed something.

 fs/ubifs/gc.c | 4 ----
 1 file changed, 4 deletions(-)
fs/ubifs/gc.c +0 -0
index 9718da8..821b348 100644

fs/ubifs/gc.c static int switch_gc_head(struct ubifs_info *c) · line 105

Quoted 10 lines
fs/ubifs/gc.c +0 -4
@@ -100,10 +100,6 @@ static int switch_gc_head(struct ubifs_info *c)
 	if (err)
 		return err;
 
-	err = ubifs_wbuf_sync_nolock(wbuf);
-	if (err)
-		return err;
-
 	err = ubifs_add_bud_to_log(c, GCHD, gc_lnum, 0);
 	if (err)
 		return err;

This call was introduced by:
commit cb14a18465686ea6add51b1008865b8174c28bd7

Author: Artem Bityutskiy <[email protected]>
Date:   Sun May 15 14:51:54 2011 +0300

UBIFS: synchronize write-buffer before switching to the next bud

Which basically syncs the wbuf before each ubifs_add_bud_to_log(). In switch_gc_head() we synced already before ubifs_leb_unmap(). So either the said commit oversaw that sync call or I miss something.

But AFACT your change is correct. Artem, can you please confirm? Boris, didn't discuss that redundancy while inspecting UBIFS wrt. MLC support?

Thanks,
//richard

#2 lore raw
Quoted 37 lines · On Thu, 23 Jun 2016 09:47:15 +0200 Richard Weinberger <[email protected]> wrote:

Am 23.06.2016 um 07:53 schrieb Sylvain Etienne:

Quoted 17 lines

The wbuf is already sync-ed before ubifs_leb_unmap()

---

Notes:
This is my first patch on this mailing list. Please let me know if I missed something.

 fs/ubifs/gc.c | 4 ----
 1 file changed, 4 deletions(-)
fs/ubifs/gc.c +0 -0
index 9718da8..821b348 100644

fs/ubifs/gc.c static int switch_gc_head(struct ubifs_info *c) · line 105

Quoted 10 lines
fs/ubifs/gc.c +0 -4
@@ -100,10 +100,6 @@ static int switch_gc_head(struct ubifs_info *c)
 	if (err)
 		return err;
 
-	err = ubifs_wbuf_sync_nolock(wbuf);
-	if (err)
-		return err;
-
 	err = ubifs_add_bud_to_log(c, GCHD, gc_lnum, 0);
 	if (err)
 		return err;  

This call was introduced by:
commit cb14a18465686ea6add51b1008865b8174c28bd7

Author: Artem Bityutskiy <[email protected]>
Date:   Sun May 15 14:51:54 2011 +0300

UBIFS: synchronize write-buffer before switching to the next bud

Quoted 7 lines

Which basically syncs the wbuf before each ubifs_add_bud_to_log(). In switch_gc_head() we synced already before ubifs_leb_unmap(). So either the said commit oversaw that sync call or I miss something.

But AFACT your change is correct. Artem, can you please confirm? Boris, didn't discuss that redundancy while inspecting UBIFS wrt. MLC support?

Yes, I remember proposing the same patch (though I never posted it on the ML). It seems to be useless, but let's wait for Artem's confirmation.