* ramdisk driver strange behaviour
@ 2006-04-14 13:59 Gyorgy Szekely
2006-04-14 21:59 ` Jan Engelhardt
2006-04-17 22:29 ` Nathan Scott
0 siblings, 2 replies; 3+ messages in thread
From: Gyorgy Szekely @ 2006-04-14 13:59 UTC (permalink / raw)
To: linux-kernel
hi,
i'm trying to use a ramdisk driver (block/rd.c) and experienced some
very strnage behaviour. In brief:
If I set ramdisk_blocksize=512 on the kernel command line, the driver
operates oddly. I execute the following commands in a shell:
mkfs.ext2 /dev/ram0 ~runs fine, no errors
mount /dev/ram0 /mnt/disk ~doesn't mount the filesystem, can't find
it on device
mkfs.ext2 /dev/ram0 ~runs fine, same as above
mount /dev/ram0 /mnt/disk ~mounts fine
I have to make exactly this command sequence, to make the fs usable,
eg: mkfs.ext2 twice without trying to mount doesn't work. Once the
mount succeeds everything works fine, i can read/write files,
unmount/remount everything as expected.
I copied the ramdisk contents with dd into a file, and after the first
pass it's all zeros nothing else. Like the first mkfs didn't do
anything.
If I remove the ramdisk_blocksize option from the kernel command line
(defaults to 1024) then all is ok.
Test configs:
Linux 2.6.15.2 x86 (stock kernel.org kernel)
ramdisk config: 4 ramdisks of 1024k
ucLinux 2.6.14 ARM/nommu
ramdisk config: 4 ramdisks of 1024k
George
ps: i'm not subscribet to LKML, please CC me.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: ramdisk driver strange behaviour
2006-04-14 13:59 ramdisk driver strange behaviour Gyorgy Szekely
@ 2006-04-14 21:59 ` Jan Engelhardt
2006-04-17 22:29 ` Nathan Scott
1 sibling, 0 replies; 3+ messages in thread
From: Jan Engelhardt @ 2006-04-14 21:59 UTC (permalink / raw)
To: Gyorgy Szekely; +Cc: linux-kernel
>
>mkfs.ext2 /dev/ram0 ~runs fine, no errors
>mount /dev/ram0 /mnt/disk ~doesn't mount the filesystem, can't find
>it on device
>mkfs.ext2 /dev/ram0 ~runs fine, same as above
>mount /dev/ram0 /mnt/disk ~mounts fine
>
Is ramdisk and ext2/ext3 compiled in, or as a module?
Jan Engelhardt
--
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: ramdisk driver strange behaviour
2006-04-14 13:59 ramdisk driver strange behaviour Gyorgy Szekely
2006-04-14 21:59 ` Jan Engelhardt
@ 2006-04-17 22:29 ` Nathan Scott
1 sibling, 0 replies; 3+ messages in thread
From: Nathan Scott @ 2006-04-17 22:29 UTC (permalink / raw)
To: Gyorgy Szekely; +Cc: linux-kernel
On Fri, Apr 14, 2006 at 03:59:07PM +0200, Gyorgy Szekely wrote:
> hi,
> i'm trying to use a ramdisk driver (block/rd.c) and experienced some
> very strnage behaviour. In brief:
> If I set ramdisk_blocksize=512 on the kernel command line, the driver
> operates oddly. I execute the following commands in a shell:
>
> mkfs.ext2 /dev/ram0 ~runs fine, no errors
> mount /dev/ram0 /mnt/disk ~doesn't mount the filesystem, can't find
> it on device
> mkfs.ext2 /dev/ram0 ~runs fine, same as above
> mount /dev/ram0 /mnt/disk ~mounts fine
>
> I have to make exactly this command sequence, to make the fs usable,
> eg: mkfs.ext2 twice without trying to mount doesn't work. Once the
> mount succeeds everything works fine, i can read/write files,
> unmount/remount everything as expected.
> I copied the ramdisk contents with dd into a file, and after the first
> pass it's all zeros nothing else. Like the first mkfs didn't do
> anything.
>
> If I remove the ramdisk_blocksize option from the kernel command line
> (defaults to 1024) then all is ok.
I wonder if this is a strange artifact of the supported blocksizes
for the filesystem you're using...
mkfs.ext2 ...
-b block-size
Specify the size of blocks in bytes. Valid block size
vales are 1024, 2048 and 4096 bytes per block. ...
During mount the filesystem will tell the driver what its minimum
block size is, and the driver is meant to validate that, and return
an error if its too small. Whats probably happening in your case
is a failure to handle the too-small case correctly... oh, hmm, yes,
look at the callers of set_blocksize -- in ext3 its return value is
not being checked afaict, and in ext2 I'm not sure where this setup
is done (doesn't seem to be a set_blocksize call there at all - hmm).
You might try XFS too as a data point - XFS will permit a 512 byte
filesystem blocksize - so try mkfs.xfs -bsize=512 /dev/ram0 and see
if that mounts OK first go... that'd backup the above theory if it
does.
cheers.
--
Nathan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-04-17 22:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-14 13:59 ramdisk driver strange behaviour Gyorgy Szekely
2006-04-14 21:59 ` Jan Engelhardt
2006-04-17 22:29 ` Nathan Scott
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®