Skip to contentSkip to conversation

pvcreate: conditionally wipe swap signatures

PATCH New Petr Rockai 3 participants 3 messages Mar 16, 2009 – Mar 17, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pvcreate: conditionally wipe swap signatures

Hi,

this should address https://bugzilla.redhat.com/show_bug.cgi?id=443062 -- the first patch implements the actual check, in the spirit of dev_is_md (it also gets a check in the testsuite). The code is based on swap signature detection in swapon implementation of util-linux-ng:
http://git.kernel.org/?p=utils/util-linux-ng/util-linux-ng.git;a=blob_plain;f=mount/swapon.c

The latter patch just throws in some checks that the old code misses. They might as well be redundant (or not, depends on how you look at it). Personally, I am ambivalent -- advice about (non-)inclusion sought.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: lvm-pvcreate-wipe-swap.diff
Type: text/x-diff
Size: 4790 bytes
Desc: pvcreate-wipe-swap.diff
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20090316/8f5d0a79/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lvm-pvcreate-paranoia.diff
Type: text/x-diff
Size: 1662 bytes
Desc: lvm-pvcreate-paranoia.diff
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20090316/8f5d0a79/attachment-0001.bin>
-------------- next part --------------

Yours,
Petr.

Signature · 6 lines
Peter Rockai | me()mornfall!net | prockai()redhat!com
 http://blog.mornfall.net | http://web.mornfall.net

"In My Egotistical Opinion, most people's C programs should be
 indented six feet downward and covered with dirt."
     -- Blair P. Houghton on the subject of C program indentation
#1 lore raw

PATCH 1/1 pvcreate: conditionally wipe swap signatures

Quoted 8 lines · Peter Rockai

this should address https://bugzilla.redhat.com/show_bug.cgi?id=443062 -- the first patch implements the actual check, in the spirit of dev_is_md (it also gets a check in the testsuite). The code is based on swap signature detection in swapon implementation of util-linux-ng:
http://git.kernel.org/?p=utils/util-linux-ng/util-linux-ng.git;a=blob_plain;f=mount/swapon.c
The latter patch just throws in some checks that the old code misses. They might as well be redundant (or not, depends on how you look at it). Personally, I am ambivalent -- advice about (non-)inclusion sought.

Ack to both patches.

Alasdair

Signature · 1 line
agk at redhat.com
#2 lore raw

PATCH 1/1 pvcreate: conditionally wipe swap signatures

In reply to Petr Rockai
Quoted 10 lines · Petr Rockai

this should address https://bugzilla.redhat.com/show_bug.cgi?id=443062 -- the first patch implements the actual check, in the spirit of dev_is_md (it also gets a check in the testsuite). The code is based on swap signature detection in swapon implementation of util-linux-ng:
http://git.kernel.org/?p=utils/util-linux-ng/util-linux-ng.git;a=blob_plain;f=mount/swapon.c

The latter patch just throws in some checks that the old code misses. They might as well be redundant (or not, depends on how you look at it). Personally, I am ambivalent -- advice about (non-)inclusion sought.

Milan
--
mbroz at redhat.com

nit-picking mode:

+int dev_is_swap(struct device *dev, uint64_t *signature) +{
+ char buf[10];

why not char buf[SIGNATURE_SIZE]; ?