[lvm-devel] [QUESTION] lvmcache_label_scan: checksum error at offset xxx

Wu Guanghao wuguanghao3 at huawei.com
Wed Jun 9 09:32:39 UTC 2021


Hi,

lvcreate and lvremove execute lvmcache_label_scan() to read the metadata on the lvm device,
but no lock is added for protection. if other processes are currently executing vg_commit() to submit metadata,
then it will go wrong.


lvremove (process1)					
   |--> lvmcache_label_scan()(no lock protection)				
		|-> read metadata data
			 |
			 |
			 | 			
			 |--------->lvm device metadata  				


lvremove (process2)
  ...
  |--> lockd_vg(process_vg)
  |    (Lock the vg that needs to be processed)
  ...
  |--> vg_commit() 								
  	   |--> write metadata data
		     |-----------------> lvm device metadata
  ...
  |--> unlock_vg(process_vg)

Wu Guanghao




More information about the lvm-devel mailing list