2002-03-26 14:26:36

by Tigran Aivazian

[permalink] [raw]
Subject: initrd and BLKFLSBUF

Hello,

Is blockdev --flushbufs supposed to work on /dev/ram0 if it was loaded as
initrd ramdisk? I unmount it and try to free the memory but hit this
EBUSY in drivers/block/rd.c:rd_ioctl():

/* special: we want to release the ramdisk memory,
it's not like with the other blockdevices where
this ioctl only flushes away the buffer cache. */
if ((atomic_read(&inode->i_bdev->bd_openers) > 2))
return -EBUSY;

The kernel is 2.4.9 but this code is almost the same in 2.4.18. So, who is
this opener that keeps the inode->i_bdev->bd_openers too high?

Regards,
Tigran


2002-03-27 11:11:19

by Tigran Aivazian

[permalink] [raw]
Subject: Re: initrd and BLKFLSBUF

amazing that people start adding complications (all that "bdev" filesystem
stuff in recent kernels) without first getting the basics right -- the
bd_openers accounting doesn't seem to be correct.

On Tue, 26 Mar 2002, Tigran Aivazian wrote:

> Hello,
>
> Is blockdev --flushbufs supposed to work on /dev/ram0 if it was loaded as
> initrd ramdisk? I unmount it and try to free the memory but hit this
> EBUSY in drivers/block/rd.c:rd_ioctl():
>
> /* special: we want to release the ramdisk memory,
> it's not like with the other blockdevices where
> this ioctl only flushes away the buffer cache. */
> if ((atomic_read(&inode->i_bdev->bd_openers) > 2))
> return -EBUSY;
>
> The kernel is 2.4.9 but this code is almost the same in 2.4.18. So, who is
> this opener that keeps the inode->i_bdev->bd_openers too high?
>
> Regards,
> Tigran
>
>