Re: help with cache

Andrew Clausen (clausen@alphalink.com.au)
Sun, 18 Jul 1999 08:04:50 -0400


Tim Waugh wrote:
>
> On Sat, 17 Jul 1999, Andrew Clausen wrote:
>
> > I'm writing a Partition Magic clone, and I've got a spare hard drive to
> > test it with.
>
> Excellent! What stage is it at?

I've got my fat16/32 resizer running with lots of limitations (can only
move end of partition, and in most cases, only shrink...) at
www.alphalink.com.au/~clausen/fsresize

I've almost got it to remove all of the above restrictions, with a much
nicer API, at:
www.alphalink.com.au/~clausen/parted

Lennert's ext2 resizer (which will eventually become part of GNU parted)
is also coming along: www.dsv.nl/~buytenh/ext2resize

> I don't know the answer myself, but fdisk does this:
>
> write(1, "Calling ioctl() to re-read parti"..., 44) = 44
> sync() = 0

This part seems sane :-)

> nanosleep({2, 0}, {2, 0}) = 0

Why does it need to sleep() ?

> ioctl(3, BLKRRPARTSCSI device sdb: hdwr sector= 512 bytes. Sectors= 675484 [329 MB] [0.3 GB]
> sdb: sdb1 sdb2 sdb3
> , 0x2) = 0

What does an ioctl() of 2 do?

> Does that help?

I don't believe in magic :-) Correct me if I'm wrong, but if I do:

$ dd if=/dev/zero of=/dev/hdb1 bs=512 count=1024

then

$ mount /dev/hdb1

should fail, right? It should even be able to probe what fs type it is,
let alone mount it.

Well it DOESN'T! It only "doesn't work" after I run parted, and it
fails.

OOPS - I just noticed that close() doesn't get called on the
device (/dev/hdb) after an error. So I guess it's only fopen()ed files
that get flushed and closed. But it still seems a bit dodgey that the
cache keeps the data, even after writes succeed from other processes.

Andrew Clausen

-
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/