Skip to contentSkip to conversation

Why can't I flush /dev/ram0?

DISCUSSION Kelledin Tane 10 participants 17 messages Jun 18, 2001 – Jun 19, 2001 Block layer

lore
Share & tools
lore
#0 lore raw

At this point, I'm trying to get an initrd working properly. So far, it works, the system boots, etc. etc., but whenever I try to do a "blockdev --flushbufs /dev/ram0", I get "device or resource busy"

When I mount the filesystem to check it out, nothing appears to have anything open on the filesystem. So why am I not able to flush it clean?

This is kernel 2.4.5 stock, btw.

Kelledin

#1 lore raw
Quoted 4 lines · Kelledin Tane

At this point, I'm trying to get an initrd working properly. So far, it works, the system boots, etc. etc., but whenever I try to do a "blockdev --flushbufs /dev/ram0", I get "device or resource busy"

Quoted 8 lines

When I mount the filesystem to check it out, nothing appears to have anything open on the filesystem. So why am I not able to flush it clean?

This is kernel 2.4.5 stock, btw.

Kelledin

If you have a directory called /initrd, in your root file-system, you may find that the old initrd is still mounted:

Script started on Mon Jun 18 17:22:20 2001

# ls /initrd
bin  dev  etc  lib  linuxrc  sbin
# umount /initrd
# ls /initrd
# exit
exit
Script done on Mon Jun 18 17:22:44 2001

Unmount it first.

Cheers,
Dick Johnson

Penguin : Linux version 2.4.1 on an i686 machine (799.53 BogoMips).

"Memory is like gasoline. You use it up when you are running. Of course you get it all back when you reboot..."; Actual explanation obtained from the Micro$oft help desk.

#2 lore raw
Quoted 12 lines

If you have a directory called /initrd, in your root file-system, you may find that the old initrd is still mounted:

Script started on Mon Jun 18 17:22:20 2001

# ls /initrd
bin  dev  etc  lib  linuxrc  sbin
# umount /initrd
# ls /initrd
# exit
exit
Script done on Mon Jun 18 17:22:44 2001
Quoted 1 line

Unmount it first.

I actually had something to that effect in my rc.sysinit file. It unmounted /initrd, removed it, and attempted to flush ram0. I started trying it manually when that didn't work =(

Funny thing though (not entirely unexpected)--/initrd's not in /etc/mtab. I can see why. Also, /proc/sys/kernel/real-root-dev is still 0x0100 (/dev/ram0). Changing it to 0x0301 (/dev/hda1) doesn't help, but it might be a clue for those who know this stuff better than I do.

Kelledin

#3 lore raw
In reply to Kelledin Tane
Quoted 7 lines · Kelledin Tane

At this point, I'm trying to get an initrd working properly. So far, it works, the system boots, etc. etc., but whenever I try to do a "blockdev --flushbufs /dev/ram0", I get "device or resource busy"

When I mount the filesystem to check it out, nothing appears to have anything open on the filesystem. So why am I not able to flush it clean?

Because of a bug present in Linus tree. Try this patch:

drivers/block/rd.c +1 -0
@@ -690,6 +690,7 @@
 done:
 	if (infile.f_op->release)
 		infile.f_op->release(inode, &infile);
+	blkdev_put(out_inode->i_bdev, BDEV_FILE);
 	set_fs(fs);
 	return;
 free_inodes: /* free inodes on error */ 

BTW, it's fixed in -ac patches.

Jan

Signature · 3 lines
Jan Rękorajski            |  ALL SUSPECTS ARE GUILTY. PERIOD!
baggins<at>mimuw.edu.pl   |  OTHERWISE THEY WOULDN'T BE SUSPECTS, WOULD THEY?
BOFH, MANIAC              |                   -- TROOPS by Kevin Rubio
#4 lore raw
In reply to Kelledin Tane
Quoted 5 lines
Quoted 3 lines

When I mount the filesystem to check it out, nothing appears to have anything open on the filesystem. So why am I not able to flush it clean?

Because of a bug present in Linus tree. Try this patch:

Thanks, that seems to have fixed it. There's something else I'm curious about though...

Before, when I was having this problem, I would check mem usage, and there would be about 5MB of physical memory marked for "buffers" (I assume 4MB for ram0).

Now, using an identical kernel configuration, an identical module set loaded, and a roughly identical process table, there's about 18MB of memory marked for "buffers!"

Sorry to be a bother, but I can't help wondering if this patch might have gotten rid of one problem and replaced it with another? Or maybe I'm missing some other detail here...

Kelledin

bash-2.05 $ kill -9 1
init: Just what do you think you're doing, Dave?

#5 lore raw

Linux 2.4.6-pre3 breaks ReiserFS mount on boot

In reply to Kelledin Tane

When diffing 2.4.6-pre2 & pre3 I noticed some reiserfs code was changed. This seems to cause VFS to panic via reiserfs.

Anyone else notice this?

Shawn.

#6 lore raw

Re: Linux 2.4.6-pre3 breaks ReiserFS mount on boot

Quoted 5 lines · On Monday, June 18, 2001 10:58:57 PM -0400 Shawn Starr <[email protected]> wrote:

When diffing 2.4.6-pre2 & pre3 I noticed some reiserfs code was changed. This seems to cause VFS to panic via reiserfs.

Anyone else notice this?

What is the panic message?

-chris

#7 lore raw

Re: Linux 2.4.6-pre3 breaks ReiserFS mount on boot

In reply to Kelledin Tane
Quoted 4 lines · Shawn Starr

When diffing 2.4.6-pre2 & pre3 I noticed some reiserfs code was changed. This seems to cause VFS to panic via reiserfs.

Anyone else notice this?

I don't, and I boot on reiserfs.

OG.

#8 lore raw

Re: Linux 2.4.6-pre3 breaks ReiserFS mount on boot

Two things:

1) It broke apparently with gcc 2.95.3 when patching from 2.4.6-pre2 -> 2.4.6pre3

2) I tried building it with gcc 3.00 and had same result.

3) I now have gcc 3.00 and going to rebuild 2.4.6-pre2 and see if reiserfs panics if it doesn't there's an issue with the new pre3 modifications.

I hope ReiserFS *MAINTAINS* compatability from slightly older revisions, or even migrates systems over to handle new issues.

Shawn.

Quoted 16 lines · Olivier Galibert
Quoted 4 lines · Shawn Starr

When diffing 2.4.6-pre2 & pre3 I noticed some reiserfs code was changed. This seems to cause VFS to panic via reiserfs.

Anyone else notice this?

I don't, and I boot on reiserfs.

OG.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#9 lore raw

Re: Linux 2.4.6-pre3 breaks ReiserFS mount on boot

read_super_block: can't find a reiserfs filesystem on dev 03:42
read_old_super_block: try to find super block in old location
read_old_super_block: can't find a reiserfs filesystem on dev 03:42 Kernel Panic: VFS: Unable to mount root fs on 03:42

my super block broke somewhere?

Shawn.

Quoted 36 lines · Shawn Starr

Two things:

1) It broke apparently with gcc 2.95.3 when patching from 2.4.6-pre2 -> 2.4.6pre3

2) I tried building it with gcc 3.00 and had same result.

3) I now have gcc 3.00 and going to rebuild 2.4.6-pre2 and see if reiserfs panics if it doesn't there's an issue with the new pre3 modifications.

I hope ReiserFS *MAINTAINS* compatability from slightly older revisions, or even migrates systems over to handle new issues.

Shawn.

Quoted 16 lines · Olivier Galibert
Quoted 4 lines · Shawn Starr

When diffing 2.4.6-pre2 & pre3 I noticed some reiserfs code was changed. This seems to cause VFS to panic via reiserfs.

Anyone else notice this?

I don't, and I boot on reiserfs.

OG.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#10 lore raw

Re: Linux 2.4.6-pre3 breaks ReiserFS mount on boot

Quoted 7 lines · On Monday, June 18, 2001 11:57:16 PM -0400 Shawn Starr <[email protected]> wrote:

read_super_block: can't find a reiserfs filesystem on dev 03:42
read_old_super_block: try to find super block in old location
read_old_super_block: can't find a reiserfs filesystem on dev 03:42 Kernel Panic: VFS: Unable to mount root fs on 03:42

my super block broke somewhere?

Well, this one is usually due to massive corruption or a configuration error. Are the correct drives and controllers found during boot?

-chris

#11 lore raw

Re: Linux 2.4.6-pre3 breaks ReiserFS mount on boot

In reply to Shawn Starr
Quoted 7 lines · Shawn Starr

read_super_block: can't find a reiserfs filesystem on dev 03:42
read_old_super_block: try to find super block in old location
read_old_super_block: can't find a reiserfs filesystem on dev 03:42 Kernel Panic: VFS: Unable to mount root fs on 03:42

my super block broke somewhere?

Out of curiousity, what device are you trying to boot from? 03:42, at least according to linux/Documentation/devices.txt, corresponds to /dev/hda42.

Is that really the disk you're trying to mount? I'm not familiar with how some IDE RAID controllers present disks, but it was the first thing I noticed.

-Jeff

Signature · 3 lines
Jeff Mahoney
[email protected]
[email protected]
#12 lore raw

Re: Linux 2.4.6-pre3 breaks ReiserFS mount on boot

In reply to Shawn Starr
Quoted 8 lines · Neil Brown
Quoted 7 lines · On Tuesday June 19, [email protected] wrote:
Quoted 6 lines · Shawn Starr

read_super_block: can't find a reiserfs filesystem on dev 03:42
read_old_super_block: try to find super block in old location
read_old_super_block: can't find a reiserfs filesystem on dev 03:42 Kernel Panic: VFS: Unable to mount root fs on 03:42

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

my super block broke somewhere?

Out of curiousity, what device are you trying to boot from? 03:42, at least according to linux/Documentation/devices.txt, corresponds to /dev/hda42.

or, noting that kdevname used hexadecimal,
/dev/hdb2

Ugh. Ignore me, I should've known that.

-Jeff

Signature · 3 lines
Jeff Mahoney
[email protected]
[email protected]
#13 lore raw

Re: Linux 2.4.6-pre3 breaks ReiserFS mount on boot

In reply to Shawn Starr
Quoted 4 lines · Shawn Starr

1) It broke apparently with gcc 2.95.3 when patching from 2.4.6-pre2 -> 2.4.6pre3

2) I tried building it with gcc 3.00 and had same result.

hmm, how ironic, i just had 2.4.5ac15 lock up when untarring gcc 3.0 on a reiserfs partition (/)

This after only using ac15 for a few hours... I've never seen anything like that with ac13, which I've used for days.

Justin

#14 lore raw

Re: Linux 2.4.6-pre3 breaks ReiserFS mount on boot

Quoted 3 lines

This after only using ac15 for a few hours... I've never seen anything like that with ac13, which I've used for days.

Is ac14 stable for you ?

#15 lore raw

Re: Linux 2.4.6-pre3 breaks ReiserFS mount on boot

Quoted 6 lines · On Tuesday, June 19, 2001 10:33:49 AM +0100 Alan Cox…
Quoted 3 lines

This after only using ac15 for a few hours... I've never seen anything like that with ac13, which I've used for days.

Is ac14 stable for you ?

Hi Justin,

ac14 was the first with a big reiserfs cleanup patch from me, so it would be great if you could try it to help narrow things down a bit.

I can also just send you the patch to reverse, it might be faster, just let me know which way you'd prefer.

-chris

#16 lore raw

Re: Linux 2.4.6-pre3 breaks ReiserFS mount on boot

In reply to Alan Cox

I have a server on ac12 and it crashes nearly every day, BUG in slab.c:1244.

invalid operand: 0000
CPU:    0
EIP:    0010:[<c01261f3>]

Using defaults from ksymoops -t elf32-i386 -a i386
EFLAGS: 00010082
eax: 0000001b ebx: c13bf768 ecx: c033e160 edx: 0000262a
esi: c9a5e000 edi: 00001000 ebp: 00000246 esp: ca1ddf2c
ds: 0018 es: 0018 ss: 0018
Process proftpd (pid: 27352, stackpage=ca1dd000)

Stack: c02beba5 000004dc c596faa0 00000000 c596fbac c596fb78 00001000 c9a5e000
      c027c042 00000810 00000007 c596faa0 c35f2b54 ffffffea bffff39c 
00000004
      c0293d2e c596faa0 c35f2b54 00000001 080628b8 c025919b c35f2b54 
00000001
Call Trace: [<c027c042>] [<c0293d2e>] [<c025919b>] [<c0259b8e>] [<c0259bf3>]
  [<c0106aa7>]
Code: 0f 0b 83 c4 08 f6 43 11 04 74 55 b8 a5 c2 0f 17 87 46 00 3d
Quoted 1 line
Quoted 1 line

EIP; c01261f3 <kmalloc+123/1bc> <=====

Trace; c027c042 <tcp_listen_start+5e/144>
Trace; c0293d2e <inet_listen+5a/bc>
Trace; c025919b <sys_listen+37/50>
Trace; c0259b8e <sys_socketcall+32/1bc>
Trace; c0259bf3 <sys_socketcall+97/1bc>
Trace; c0106aa7 <system_call+37/40>
Code; c01261f3 <kmalloc+123/1bc>
00000000 <_EIP>:

Code;  c01261f3 <kmalloc+123/1bc>   <=====
  0:   0f 0b                     ud2a      <=====
Code;  c01261f5 <kmalloc+125/1bc>
  2:   83 c4 08                  add    $0x8,%esp
Code;  c01261f8 <kmalloc+128/1bc>
  5:   f6 43 11 04               testb  $0x4,0x11(%ebx)
Code;  c01261fc <kmalloc+12c/1bc>
  9:   74 55                     je     60 <_EIP+0x60> c0126253 
<kmalloc+183/1bc>
Code;  c01261fe <kmalloc+12e/1bc>
  b:   b8 a5 c2 0f 17            mov    $0x170fc2a5,%eax
Code;  c0126203 <kmalloc+133/1bc>
 10:   87 46 00                  xchg   %eax,0x0(%esi)
Code;  c0126206 <kmalloc+136/1bc>
 13:   3d 00 00 00 00            cmp    $0x0,%eax

It's the same bug as the previous kernel I tried running, ac8 was it..

-d

Quoted 13 lines · Alan Cox
Quoted 3 lines

This after only using ac15 for a few hours... I've never seen anything like that with ac13, which I've used for days.

Is ac14 stable for you ?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/