The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: Nigel Kukard <nkukard@lbsd.net>
Cc: Denis Vlasenko <vda@port.imtp.ilyichevsk.odessa.ua>,
	linux-kernel@vger.kernel.org
Subject: Re: 2.6.9bk6 msdos fs OOPS
Date: Thu, 28 Oct 2004 18:23:31 +0900	[thread overview]
Message-ID: <873bzzw60c.fsf@devron.myhome.or.jp> (raw)
In-Reply-To: <4180A9A4.4000503@lbsd.net> (Nigel Kukard's message of "Thu, 28 Oct 2004 08:11:16 +0000")

Nigel Kukard <nkukard@lbsd.net> writes:

> OOPS is 100% reproducable. I boot into X, and run    eog
> /mnt/camera/dcim/100cresi    and BANG.

This is known problem. Can you please try the following patch?
Then, please send debugging output.

Thanks.
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>



Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
---

 fs/fat/cache.c |   41 ++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 40 insertions(+), 1 deletion(-)

diff -puN fs/fat/cache.c~fat-debug fs/fat/cache.c
--- linux-2.6.9-final-a/fs/fat/cache.c~fat-debug	2004-10-17 23:45:27.000000000 +0900
+++ linux-2.6.9-final-a-hirofumi/fs/fat/cache.c	2004-10-18 09:38:31.000000000 +0900
@@ -11,6 +11,7 @@
 #include <linux/fs.h>
 #include <linux/msdos_fs.h>
 #include <linux/buffer_head.h>
+#include <linux/sched.h>
 
 /* this must be > 0. */
 #define FAT_MAX_CACHE	8
@@ -20,6 +21,10 @@ struct fat_cache {
 	int nr_contig;	/* number of contiguous clusters */
 	int fcluster;	/* cluster number in the file. */
 	int dcluster;	/* cluster number on disk. */
+	char comm[16];
+	pid_t pid;
+	unsigned int id;
+	unsigned long long tsc;
 };
 
 struct fat_cache_id {
@@ -134,6 +139,36 @@ static struct fat_cache *fat_cache_merge
 	return NULL;
 }
 
+static void fat_cache_check(struct inode *inode, struct fat_cache_id *new)
+{
+	struct fat_cache *p;
+	unsigned long long tsc;
+
+	if (new->id == FAT_CACHE_VALID) {
+		list_for_each_entry(p, &MSDOS_I(inode)->cache_lru, cache_list) {
+			/* Find the same part as "new" in cluster-chain. */
+			if (p->fcluster == new->fcluster) {
+				BUG_ON(p->dcluster != new->dcluster);
+				goto dump_cache;
+			}
+		}
+	}
+	return;
+
+dump_cache:
+	rdtscll(tsc);
+	printk("%s: tsc %llu, comm %s, pid %d, id %u, "
+	       "contig %d, fclus %d, dclus %d\n",
+	       __FUNCTION__, tsc, current->comm, current->pid, new->id,
+	       new->nr_contig, new->fcluster, new->dcluster);
+	list_for_each_entry(p, &MSDOS_I(inode)->cache_lru, cache_list) {
+		printk("tsc %llu, comm %s, pid %d, id %u, "
+		       "contig %d, fclus %d, dclus %d\n",
+		       p->tsc, p->comm, p->pid, p->id,
+		       p->nr_contig, p->fcluster, p->dcluster);
+	}
+}
+
 static void fat_cache_add(struct inode *inode, struct fat_cache_id *new)
 {
 	struct fat_cache *cache, *tmp;
@@ -146,8 +181,8 @@ static void fat_cache_add(struct inode *
 	    new->id != MSDOS_I(inode)->cache_valid_id)
 		goto out;	/* this cache was invalidated */
 
+	fat_cache_check(inode, new);
 	cache = fat_cache_merge(inode, new);
-	BUG_ON(new->id == FAT_CACHE_VALID && cache != NULL);
 	if (cache == NULL) {
 		if (MSDOS_I(inode)->nr_caches < fat_max_cache(inode)) {
 			MSDOS_I(inode)->nr_caches++;
@@ -171,6 +206,10 @@ static void fat_cache_add(struct inode *
 		cache->nr_contig = new->nr_contig;
 	}
 out_update_lru:
+	strcpy(cache->comm, current->comm);
+	cache->pid = current->pid;
+	cache->id = new->id;
+	rdtscll(cache->tsc);
 	fat_cache_update_lru(inode, cache);
 out:
 	spin_unlock(&MSDOS_I(inode)->cache_lru_lock);

  reply	other threads:[~2004-10-28  9:24 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-28  7:00 2.6.9bk6 msdos fs OOPS Nigel Kukard
2004-10-28  7:55 ` Denis Vlasenko
2004-10-28  8:11   ` Nigel Kukard
2004-10-28  9:23     ` OGAWA Hirofumi [this message]
2004-10-28 10:50       ` Nigel Kukard
2004-10-28 13:18         ` OGAWA Hirofumi
2004-10-28 11:14       ` Gene Heskett
2004-10-28 11:59         ` Gene Heskett
2004-10-28 12:12         ` Gene Heskett
2004-10-28 13:21           ` OGAWA Hirofumi
2004-10-28 15:24             ` Nigel Kukard
2004-10-28 15:58               ` OGAWA Hirofumi
2004-10-28 18:32               ` Gene Heskett
2004-10-28 18:32             ` Gene Heskett
2004-10-28 19:50               ` OGAWA Hirofumi
2004-10-28 23:05                 ` Gene Heskett
2004-10-29  0:01                   ` OGAWA Hirofumi
2004-10-29  4:50                     ` Gene Heskett
2004-10-29  5:31                       ` Gene Heskett
2004-10-28  8:21 ` Al Viro

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=873bzzw60c.fsf@devron.myhome.or.jp \
    --to=hirofumi@mail.parknet.co.jp \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nkukard@lbsd.net \
    --cc=vda@port.imtp.ilyichevsk.odessa.ua \
    /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