Re: [rfc][patchlet] initrd fix 2.3.39

From: Mike Galbraith (mikeg@weiden.de)
Date: Sun Jan 16 2000 - 23:54:55 EST


On Mon, 17 Jan 2000, Mike Galbraith wrote:

> On Sun, 16 Jan 2000, Frank Bernard wrote:
>
> > - if you try to make a filesystem on a ramdisk
> > (i.e. dd if=/dev/zero of=/dev/ram1 bs=1024k count=8; mke2fs /dev/ram1)
> > then everything works fine up to the moment when you want to mount
> > that ramdisk. It either gives "you must specify the filesystem type"
> > without option "-t ext2" or "wrong fs type, ...." with it.
> > The length of the ramdisk is exactly 8MB. (wc -l)
> > I will track down this point tomorrow a bit further, comparing
> > ramdisk-e2fs with file-e2fs of the same size.
>
> Abby-normal. I just checked, and it's not because of my patchlet.
> I'll see if I can figure it out.

Well heck, that was easy enough. The answer was in thread..
        'why invalidate_buffers() in blkdev_put()?'

invalidate_buffers() is what the ramdisk calls when it wants to
destroy it's protected buffers. That makes it a special case, so
I did..

--- fs/block_dev.c.org Mon Jan 17 05:33:16 2000
+++ fs/block_dev.c Mon Jan 17 05:34:20 2000
@@ -627,7 +627,7 @@
         /* syncing will go here */
         if (kind == BDEV_FILE || kind == BDEV_FS)
                 fsync_dev(rdev);
- if (atomic_dec_and_test(&bdev->bd_openers)) {
+ if (atomic_dec_and_test(&bdev->bd_openers) && MAJOR(rdev) != RAMDISK_MAJOR) {
                 /* invalidating buffers will go here */
                 invalidate_buffers(rdev);
         }

..and it now works again. Whether special casing is acceptable is
another matter entirely.

        -Mike

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Jan 23 2000 - 21:00:15 EST