public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Simon Haynes <simon@baydel.com>
To: linux-mtd@lists.infradead.org
Cc: David Woodhouse <dwmw2@infradead.org>
Subject: wbuf flush or remount ro
Date: Fri, 7 May 2004 14:42:05 +0100	[thread overview]
Message-ID: <C98EE3515623@baydel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 437 bytes --]

David,

Just to recap 

It seems that the latest jffs2 CVS code does not flush wbuf when the 
filesystem is remounted read only. This can cause a gc operation to be 
abnormally terminated an error messages are generated on remount.

A while ago you suggested I do something like this. See attached 

I don't really know how to create a patch file so here is a diff and a patch.
If the patch is not correct would you please enlighten me.

[-- Attachment #2: fs.patch --]
[-- Type: text/x-diff, Size: 818 bytes --]

--- fs.cvs	Fri May  7 14:29:45 2004
+++ fs.c	Fri May  7 14:08:40 2004
@@ -355,6 +355,13 @@
 
 	if (!(*flags & MS_RDONLY))
 		jffs2_start_garbage_collect_thread(c);
+	/* MHB hack */
+	else {
+		down(&c->alloc_sem);
+	        jffs2_flush_wbuf_pad(c);
+	        up(&c->alloc_sem);
+	}
+
 	
 	sb->s_flags = (sb->s_flags & ~MS_RDONLY)|(*flags & MS_RDONLY);
 
@@ -463,7 +470,12 @@
 	}
 
 	if (c->sector_size != c->mtd->erasesize)
+/* MHB */
+/*
 		printk(KERN_INFO "jffs2: Erase block size too small (%dKiB). Using virtual blocks size (%dKiB) instead\n", 
+			c->mtd->erasesize / 1024, c->sector_size / 1024);
+*/
+		printk(KERN_DEBUG "jffs2: Erase block size too small (%dKiB). Using virtual blocks size (%dKiB) instead\n", 
 			c->mtd->erasesize / 1024, c->sector_size / 1024);
 
 	if (c->flash_size < 5*c->sector_size) {

[-- Attachment #3: fs.diff --]
[-- Type: text/x-diff, Size: 901 bytes --]

*** fs.cvs	Fri May  7 14:29:45 2004
--- fs.c	Fri May  7 14:08:40 2004
***************
*** 355,360 ****
--- 355,367 ----
  
  	if (!(*flags & MS_RDONLY))
  		jffs2_start_garbage_collect_thread(c);
+ 	/* MHB hack */
+ 	else {
+ 		down(&c->alloc_sem);
+ 	        jffs2_flush_wbuf_pad(c);
+ 	        up(&c->alloc_sem);
+ 	}
+ 
  	
  	sb->s_flags = (sb->s_flags & ~MS_RDONLY)|(*flags & MS_RDONLY);
  
***************
*** 463,469 ****
--- 470,481 ----
  	}
  
  	if (c->sector_size != c->mtd->erasesize)
+ /* MHB */
+ /*
  		printk(KERN_INFO "jffs2: Erase block size too small (%dKiB). Using virtual blocks size (%dKiB) instead\n", 
+ 			c->mtd->erasesize / 1024, c->sector_size / 1024);
+ */
+ 		printk(KERN_DEBUG "jffs2: Erase block size too small (%dKiB). Using virtual blocks size (%dKiB) instead\n", 
  			c->mtd->erasesize / 1024, c->sector_size / 1024);
  
  	if (c->flash_size < 5*c->sector_size) {

                 reply	other threads:[~2004-05-07 13:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C98EE3515623@baydel.com \
    --to=simon@baydel.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox