All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Alexandru Harsanyi <a.harsanyi@willhart-tech.com>
Cc: Linux Mtd <linux-mtd@lists.infradead.org>
Subject: Re: DOC 2000 driver (NFTL) in kernel 2.4.7
Date: Wed, 08 Aug 2001 09:52:04 +0100	[thread overview]
Message-ID: <29728.997260724@redhat.com> (raw)
In-Reply-To: <3B70ED72.78088871@willhart-tech.com>

a.harsanyi@willhart-tech.com said:
>  However, when I mount it read-write and I write some files to the
> partition, the NFTL driver hangs my system...

> The messages are:
> ------------
> _Doc_WaitReady called for out-of-line wait
> Setting inplace to 0. VUC 194, block 2 was 0 lastEUN, and is in EUN 333 (!=) 673


/me dusts off the NFTL spec and tries to interpret that...

One of the blocks is marked BLOCK_DELETED in the Erase Unit which it's 
trying to fold the chain into. That ought to be fine - it can just leave it 
marked as deleted. I think that sanity check can be changed as follows:

Index: nftlcore.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/nftlcore.c,v
retrieving revision 1.77
diff -u -r1.77 nftlcore.c
--- nftlcore.c	2001/08/07 09:47:41	1.77
+++ nftlcore.c	2001/08/08 08:46:17
@@ -330,8 +330,17 @@
 					       "in Virtual Unit Chain %d for block %d\n",
 					       thisVUC, block);
 				break;
-			case SECTOR_IGNORE:
 			case SECTOR_DELETED:
+				if (!BlockFreeFound[block])
+					BlockMap[block] = BLOCK_NIL;
+				else
+					printk(KERN_WARNING 
+					       "SECTOR_DELETED found after SECTOR_FREE "
+					       "in Virtual Unit Chain %d for block %d\n",
+					       thisVUC, block);
+				break;
+
+			case SECTOR_IGNORE:
 				break;
 			default:
 				printk("Unknown status for block %d in EUN %d: %x\n",
@@ -350,12 +359,15 @@
 
 	if (inplace) {
 		/* We're being asked to be a fold-in-place. Check
-		   that all blocks are either present or SECTOR_FREE
-		   in the target block. If not, we're going to have
-		   to fold out-of-place anyway.
+		   that all blocks which actually have data associated
+		   with them (i.e. BlockMap[block] != BLOCK_NIL) are 
+		   either already present or SECTOR_FREE in the target
+		   block. If not, we're going to have to fold out-of-place
+		   anyway.
 		*/
 		for (block = 0; block < nftl->EraseSize / 512 ; block++) {
 			if (BlockLastState[block] != SECTOR_FREE &&
+			    BlockMap[block] != BLOCK_NIL &&
 			    BlockMap[block] != targetEUN) {
 				DEBUG(MTD_DEBUG_LEVEL1, "Setting inplace to 0. VUC %d, "
 				      "block %d was %x lastEUN, "


> Cannot fold Virtual Unit Chain 194 in place. Trying out-of-place

Regardless of the above bug, dying here is not acceptable though. 
Change the 'int silly = -1;' in NFTL_findfreeblock() to
	int silly = nftl->nb_blocks;

Dunno why it wasn't like that before.


--
dwmw2

  reply	other threads:[~2001-08-08  8:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E15RXGo-00058Q-00@pentafluge.infradead.org>
2001-08-01  3:46 ` DOC 2000 driver (NFTL) in kernel 2.4.7 Saul Thurrowgood
2001-08-07  9:36   ` David Woodhouse
2001-08-08  4:30     ` Alexandru Harsanyi
2001-08-08  6:42       ` David Woodhouse
2001-08-08  7:42         ` Alexandru Harsanyi
2001-08-08  8:52           ` David Woodhouse [this message]
2001-07-31  4:40 Alexandru Harsanyi
2001-07-31 20:45 ` David Woodhouse

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=29728.997260724@redhat.com \
    --to=dwmw2@infradead.org \
    --cc=a.harsanyi@willhart-tech.com \
    --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 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.