From: Olaf Hering <olh@suse.de>
To: linux-kernel@vger.kernel.org
Subject: Re: cramfs corruption after BLKFLSBUF on loop device
Date: Tue, 30 May 2006 15:19:34 +0200 [thread overview]
Message-ID: <20060530131934.GA6400@suse.de> (raw)
In-Reply-To: <20060529214011.GA417@suse.de>
On Mon, May 29, Olaf Hering wrote:
> This script will cause cramfs decompression errors, on SMP at least:
>
> #!/bin/bash
> while :;do blockdev --flushbufs /dev/loop0;done </dev/null &>/dev/null&
> while :;do ps faxs </dev/null &>/dev/null&done </dev/null &>/dev/null&
> while :;do dmesg </dev/null &>/dev/null&done </dev/null &>/dev/null&
> while :;do find /mounts/instsys -type f -print0|xargs -0 cat &>/dev/null;done
>
> ...
> Error -3 while decompressing!
> c0000000009592a2(2649)->c0000000edf87000(4096)
> Error -3 while decompressing!
> c000000000959298(2520)->c0000000edbc7000(4096)
> Error -3 while decompressing!
> c000000000959c70(2489)->c0000000f1482000(4096)
> Error -3 while decompressing!
> c00000000095a629(2355)->c0000000edaff000(4096)
> Error -3 while decompressing!
> ...
This change works for me, the added BUG() does not trigger.
read_cache_page() returns the page in PageUptodate() state.
But a few ticks later, invalidate_complete_page() calls ClearPageUptodate(),
on another cpu.
The SetPageDirty() works for my testcase, but not without the mb().
Does anyone know what sideeffects the SetPageDirty() has for the
loopmounted cramfs?
---
fs/cramfs/inode.c | 2 ++
fs/cramfs/uncompress.c | 1 +
2 files changed, 3 insertions(+)
Index: linux-2.6.16.16-1.6/fs/cramfs/inode.c
===================================================================
--- linux-2.6.16.16-1.6.orig/fs/cramfs/inode.c
+++ linux-2.6.16.16-1.6/fs/cramfs/inode.c
@@ -186,6 +186,8 @@ static void *cramfs_read(struct super_bl
/* synchronous error? */
if (IS_ERR(page))
page = NULL;
+ SetPageDirty(page);
+ mb();
}
pages[i] = page;
}
Index: linux-2.6.16.16-1.6/fs/cramfs/uncompress.c
===================================================================
--- linux-2.6.16.16-1.6.orig/fs/cramfs/uncompress.c
+++ linux-2.6.16.16-1.6/fs/cramfs/uncompress.c
@@ -50,6 +50,7 @@ int cramfs_uncompress_block(void *dst, i
err:
printk("Error %d while decompressing!\n", err);
printk("%p(%d)->%p(%d)\n", src, srclen, dst, dstlen);
+ BUG_ON(1);
return 0;
}
next prev parent reply other threads:[~2006-05-30 13:19 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-29 21:40 cramfs corruption after BLKFLSBUF on loop device Olaf Hering
2006-05-30 13:19 ` Olaf Hering [this message]
2006-05-30 18:24 ` Olaf Hering
2006-06-01 18:49 ` [PATCH] " Olaf Hering
2006-06-01 19:12 ` Andrew Morton
2006-06-01 19:15 ` Andrew Morton
2006-06-01 20:10 ` Olaf Hering
2006-06-01 21:24 ` Andrew Morton
2006-06-01 21:41 ` Olaf Hering
2006-06-01 21:57 ` Andrew Morton
2006-06-02 8:43 ` Olaf Hering
2006-06-02 9:11 ` Andrew Morton
2006-06-02 19:14 ` Olaf Hering
2006-06-02 19:41 ` Andrew Morton
2006-06-02 21:06 ` Olaf Hering
2006-06-02 19:37 ` Olaf Hering
2006-06-02 19:46 ` Andrew Morton
2006-06-03 13:13 ` Olaf Hering
2006-06-01 20:17 ` Chris Mason
2006-06-01 20:20 ` Olaf Hering
2006-06-01 20:29 ` Chris Mason
2006-09-20 13:20 ` Olaf Hering
2006-09-20 18:47 ` Andrew Morton
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=20060530131934.GA6400@suse.de \
--to=olh@suse.de \
--cc=linux-kernel@vger.kernel.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