Re: How can I force a read?

From: Douglas Gilbert (dougg@torque.net)
Date: Thu May 18 2000 - 07:40:26 EST


"Shyam Kaushik V" <shyam.kaushik@wipro.com> wrote:

> How can I force a read from a block device after a
> write? Basically, if I do a write to some partition
> of a disk & perform a read of the same partition of
> the same disk(to verify whether the data has been
> written properly), a read is not actually performed
> as the buffer cache's dirty bit is not set. Even if
> I try to do a sync by calling the sync system call &
> then doing a read also does'nt actually perform the
> read, instead it takes from the buffer cache & gives
> the data back. Is there a way to tell the fs
> to force an actual read from the disk?

These 2 ioctl()s against disk devices (e.g. sd and hd)
look like they could be of interest:

BLKFLSBUF [instructs disk subsystem to flush buffers]
BLKRRPART [reread the partition table]

Doug Gilbert

-
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 : Tue May 23 2000 - 21:00:15 EST