Skip to contentSkip to conversation

(3/3) Add metadata validation for snapshot

PATCH New Jun'ichi Nomura 1 participant 1 message Aug 9, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 (3/3) Add metadata validation for snapshot

Additional validation check for snapshot LV. This one is enough to prevent 'cow == origin' snapshot.

Currently, a snapshot whose origin and cow are same is silently accepted.
Example of corrupted metadata:

                snapshot0 {
                        id = "R0o4p6-DDyy-O2td-RQDJ-dRP7-24zy-90VzgR"
                        status = ["READ", "WRITE", "VISIBLE"]
                        segment_count = 1

                        segment1 {
                                start_extent = 0
                                extent_count = 1        # 4 Megabytes

                                type = "snapshot"
                                chunk_size = 16
                                origin = "lvol0"
                                cow_store = "lvol0"
                        }
                }

With this patch, we'll get a following message for such metadata:
LV snapshot0: segment 1 has a LV lvol0 for both snapshot origin and cow store

  Internal error: LV segments corrupted in snapshot0.

Thanks,

Signature · 8 lines
Jun'ichi Nomura, NEC Corporation of America
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lvm2-validate-snapshot.patch
Type: text/x-patch
Size: 741 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20070809/280f524c/attachment.bin>