mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* device mapper wierdness
@ 2010-05-28 14:55 Pozsar Balazs
  2010-06-01  3:44 ` Neil Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Pozsar Balazs @ 2010-05-28 14:55 UTC (permalink / raw)
  To: linux-kernel


Hi all,

I found a wierd caching problem, and would like to ask if this is a bug, 
and how to avoid this behaviour properly.

First of all, I have a lvm device:

root:~# ls -l /dev/dm-2 /dev/bela/gazsi
lrwxrwxrwx 1 root root       7 2010-05-28 16:17 /dev/bela/gazsi -> ../dm-2
brw-rw---- 1 root media 254, 2 2010-05-28 16:17 /dev/dm-2
root:~# dmsetup info bela-gazsi
Name:              bela-gazsi
State:             ACTIVE
Read Ahead:        256
Tables present:    LIVE
Open count:        1
Event number:      0
Major, minor:      254, 2
Number of targets: 1
UUID: 
LVM-LrFvCCU7QzeyBsiXl2RC2VMnWvxGdS4n7xugPDcPzx1vD6SVElPELv0a8vf4mzH0

root:~# dmsetup table bela-gazsi
0 15114240 linear 8:4 384


Above that, I have another device mapper device, just a simple linear 
one:

brw-rw---- 1 root media 254, 1 2010-05-28 16:27 /dev/dm-1
root:~# ls -l /dev/dm-1 /dev/mapper/live
brw-rw---- 1 root media 254, 1 2010-05-28 16:27 /dev/dm-1
lrwxrwxrwx 1 root root       7 2010-05-28 16:17 /dev/mapper/live -> ../dm-1
root:~# dmsetup info live
Name:              live
State:             ACTIVE
Read Ahead:        256
Tables present:    LIVE
Open count:        1
Event number:      0
Major, minor:      254, 1
Number of targets: 1

root:~# dmsetup table live
0 15114240 linear 254:2 0


Because of the linear mapping, we can see the fs uuid is the same on the 
two
dm devices:
root:~# blkid /dev/mapper/live /dev/bela/gazsi
/dev/mapper/live: LABEL="UHU" UUID="3452e43d-d40a-4c13-b24d-07d4b1793e9b" TYPE="ext4"
/dev/bela/gazsi: LABEL="UHU" UUID="3452e43d-d40a-4c13-b24d-07d4b1793e9b" TYPE="ext4"


Now if I change the uuid of the filesystem with tune2fs, I cannot see 
this change on the /dev/bela/gazsi device, even if I do a sync:
root:~# tune2fs -U random /dev/mapper/live
tune2fs 1.41.11 (14-Mar-2010)
root:~# blkid /dev/mapper/live /dev/bela/gazsi
/dev/mapper/live: LABEL="UHU" UUID="f3fad2d6-451a-4ef6-98f8-5fcf51571b07" TYPE="ext4"
/dev/bela/gazsi: LABEL="UHU" UUID="3452e43d-d40a-4c13-b24d-07d4b1793e9b" TYPE="ext4"
root:~# sync
root:~# blkid /dev/mapper/live /dev/bela/gazsi
/dev/mapper/live: LABEL="UHU" UUID="f3fad2d6-451a-4ef6-98f8-5fcf51571b07" TYPE="ext4"
/dev/bela/gazsi: LABEL="UHU" UUID="3452e43d-d40a-4c13-b24d-07d4b1793e9b" TYPE="ext4"


But if drop caches, it gets into the proper state:
root:~# echo 1 >/proc/sys/vm/drop_caches
root:~# blkid /dev/mapper/live /dev/bela/gazsi
/dev/mapper/live: LABEL="UHU" UUID="f3fad2d6-451a-4ef6-98f8-5fcf51571b07" TYPE="ext4"
/dev/bela/gazsi: LABEL="UHU" UUID="f3fad2d6-451a-4ef6-98f8-5fcf51571b07" TYPE="ext4"


I fail to see why a sync is not enough and how this drop cache operation
helps. Could anyone enlighten me please?


I am using kernel 2.6.33.3.

Thanks,
Balazs Pozsar

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-06-01  3:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-28 14:55 device mapper wierdness Pozsar Balazs
2010-06-01  3:44 ` Neil Brown

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®