[dm-devel] buffer/cache: Underlying device vs. mapper device

Arno Wagner wagner at tik.ee.ethz.ch
Fri Dec 17 21:17:15 UTC 2004


Hello all,

I have observed the following behaviour with the crypto mapper and
the linear mapper in 2.6.9. Since I have found no explanation
I am now asking here. What I have done is the following:

1. Map /dev/hdX (real disk) to /dev/mapper/xx

2. Write to /dev/mapper/xx (with 'dd_rescue /dev/urandom /dev/mapper/xx'
   or 'cat /dev/urandom /dev/mapper/xx', does not matter).

3. Read from /dev/hdX. 

The data read from /dev/hdX does not reflect the write to /dev/mapper/xx 
or only after a lot of data ( > main memory) has been written. Waiting
does not help. (After 1 hour still no change.)

Note: If I write to /dev/hdX, the change is seen immediately in
      /dev/mapper/xx.

My questions:

1. Does /dev/mapper/xx or /dev/hdX reflect the true state of the 
   data on disk after the above sequence? 

2. What is the problem here? 

Christophe Saout suggested to me that this could be a problem with
independent buffers for both devices. If this is the case, then it
seems the buffer of /dev/mapper/xx gets notified of changes made via
/dev/hdX, but the buffer of /dev/hdX does not get notified of changes
made via /dev/mapper/xx. Would this be a bug?

Thanks for any insights, I searched the list-archives and
the web without result. 

Arno
-- 
Arno Wagner, Dipl. Inform., CISSP --- CSG, ETH Zurich, wagner at tik.ee.ethz.ch 
GnuPG:  ID: 1E25338F  FP: 0C30 5782 9D93 F785 E79C  0296 797F 6B50 1E25 338F
----
Cuddly UI's are the manifestation of wishful thinking. -- Dylan Evans




More information about the dm-devel mailing list