LVM1 on top of DRBD
Hi list,
I'd like to use LVM1 on top of DRBD 0.6.6 and not the other way round, because I then can resize my partitions online (add a new drbd device, make it a pv, add it to a vg, be happy).
It just seems not to be that simple.
The HOWTO warns about LVM not being cluster aware and describes how to do it anyway on shared storage. I (think I) have these requirements met by using heartbeat to have vg's active at one node only and running vgscan on the secondary after changes on the primary.
I created the pv's using the /dev/nbx devices (x=1,2). I created the vg lvm-drbd with lv lv1-s2 using these pv's.
The corresponding haresources file is this:
job-vm1 192.168.1.101 datadisk::lvm1 datadisk::lvm2 LVM::lvm-drbd \
Filesystem::/dev/lvm-drbd/lv1-s2::/ha/export::reiserfs
What I get is lvm using the lower level device (sdbx in my case). vgdisplay -vD shows the pv's using /dev/sdbx.
Nothing gets replicated to the other node (not surprising then). I even patched lvm_check_dev.c and rebuilt the lvm tools to ignore /dev/sdbx devices, removed all lvm infos from /etc and did a new vgscan and vgcfgbackup. vgdisplay -vD now shows the /dev/nbx devices for the pv's. But still no replication without drbdsetup /dev/nbx replicate :-(.
I use suse 8.2 with suse 2.4.20-4GB kernel (you'ed a few weeks ago) for the lvm_check_dev.c-patch I installed the lvm source rpm, modified the spec file not to use the mp patches (because a file was missing), added my patchfile and did a rpm -bi /usr/src/packages/SPECS/lvm.spec.
Btw. the build process did not stop on compile errors in lvm_check_dev.c. Is that intended? It is confusing...
What am I doing wrong?
Is it possible doing LVM on top of DRBD at all?
I'd happily provide more details if it helps.
Ciao,
Joachim Banzhaf
Joachim,
LVM1 isn't cluster aware.
DRBD devices are just some other "local" ones for it. No replication is done by LVM1.
The whole replication process is up to DRBD, that's why you need to start it using a DRBD command.
You can use hartbeat to recognize if a node dies and scripts to start LVM on the living node to access logical volumes there.
Regards,
Heinz -- The LVM Guy --
Quoted 43 lines · Joachim Banzhaf
Hi list,
I'd like to use LVM1 on top of DRBD 0.6.6 and not the other way round, because I then can resize my partitions online (add a new drbd device, make it a pv, add it to a vg, be happy).
It just seems not to be that simple.
The HOWTO warns about LVM not being cluster aware and describes how to do it anyway on shared storage. I (think I) have these requirements met by using heartbeat to have vg's active at one node only and running vgscan on the secondary after changes on the primary.
I created the pv's using the
/dev/nbxdevices (x=1,2). I created the vg lvm-drbd with lv lv1-s2 using these pv's.The corresponding haresources file is this:
job-vm1 192.168.1.101datadisk::lvm1datadisk::lvm2LVM::lvm-drbd \
Filesystem::/dev/lvm-drbd/lv1-s2::/ha/export::reiserfsWhat I get is lvm using the lower level device (sdbx in my case). vgdisplay -vD shows the pv's using
/dev/sdbx.
Nothing gets replicated to the other node (not surprising then). I even patchedlvm_check_dev.cand rebuilt the lvm tools to ignore/dev/sdbxdevices, removed all lvm infos from /etc and did a new vgscan and vgcfgbackup. vgdisplay -vD now shows the/dev/nbxdevices for the pv's. But still no replication without drbdsetup/dev/nbxreplicate :-(.I use suse 8.2 with suse 2.4.20-4GB kernel (you'ed a few weeks ago) for the lvm_check_dev.c-patch I installed the lvm source rpm, modified the spec file not to use the mp patches (because a file was missing), added my patchfile and did a rpm -bi
/usr/src/packages/SPECS/lvm.spec.Btw. the build process did not stop on compile errors in
lvm_check_dev.c. Is that intended? It is confusing...What am I doing wrong?
Is it possible doing LVM on top of DRBD at all?I'd happily provide more details if it helps.
Ciao,
Quoted 8 lines
Joachim Banzhaf
_______________________________________________
linux-lvm mailing list
[email protected]
http://lists.sistina.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
*** Software bugs are stupid.
Nevertheless it needs not so stupid people to solve them ***
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Heinz Mauelshagen Sistina Software Inc.
Senior Consultant/Developer Am Sonnenhang 11
56242 Marienrachdorf Germany
[email protected] +49 2626 141200
FAX 924446
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Am Mittwoch, 20. August 2003 12:46 schrieb Heinz J . Mauelshagen:
Quoted 1 line
Joachim,
First, thanks for your quick response, Heinz.
Quoted 1 line
LVM1 isn't cluster aware.
I knew that - as I stated, I read the FAQ :-).
Quoted 1 line
DRBD devices are just some other "local" ones for it.
OK, but as i stated, I used them that way. LVM1 just seems to use the lower level devices drbd works on instead. That's what's bothering me. To make clear what I mean, here some details:
I have /dev/nb1 as resource lvm1 on top of /dev/sdb1 in /etc/drbd.conf I have /dev/nb2 as resource lvm2 on top of /dev/sdb2 in /etc/drbd.conf
On both nodes I did:
# /etc/init.d/drbd start
On one node I did (as far as I can remember):
# /etc/ha.d/resource.d/datadisk lvm1 start # /etc/ha.d/resource.d/datadisk lvm2 start # pvcreate /dev/nb1 # pvcreate /dev/nb2 # vgcreate lvm-drbd /dev/nb1 /dev/nb2 # lvcreate -s 2 -n lv1-s2 lvm_drbd # vgchange -a n lvm-drbd
On the other node I did (while the vg was inactive)
# rm -r /etc/lvm* # vgscan # vgcfgbackup
Now, look what vgdisplay says on PV names (on both nodes):
# vgdisplay -vD lvm-drbd --- Volume group --- VG Name lvm-drbd <skip>
--- Logical volume ---
LV Name /dev/lvm-drbd/lv1-s2
VG Name lvm-drbd
<skip>
--- Physical volumes ---
PV Name (#) /dev/sdb1 (1) PV Status available / allocatable Total PE / Free PE 30 / 15
PV Name (#) /dev/sdb2 (2) PV Status available / allocatable Total PE / Free PE 30 / 15
It just seems, the partitions are found before their associated network block devices and used despite of pvcreate commandline options.
As I stated, to follow this hypothesis I used a patch to make lvm tools ignore the partitions /dev/sdbx.
The vgdisplay output then shows the nbx devices (even without vgscan'ning or something). But they are not used by the kernel anyway as I see no activity on /proc/drbd :-(
Quoted 1 line
No replication is done by LVM1.
Yes, that's why I use drbd :-)
Quoted 5 lines
The whole replication process is up to DRBD, that's why you need to start it using a DRBD command.
You can use hartbeat to recognize if a node dies and scripts to start LVM on the living node to access logical volumes there.
I have a fully working set of linux, lvm1, heartbeat and drbd with services on top. I know how they work (from a user/admin perspective - and a bit more). And they work fine for me (including failovers of course) as long as I use drbd resources on top of lv's.
But I want to use drbd resources as pv's.
That seems not to work, because LVM1 persists in using the partition and not the drbd network block device although I configured it that way (as stated my original post).
Again, to clear the ground: Should it be possible at all to use pv's on top of drbd devices or am I forced to use drbd devices on top of lv's and loose things like online resize feature?
Have you - or anybody reading the list - ever sucessfully used that scenario?
Quoted 76 lines
Regards,
Heinz -- The LVM Guy --Quoted 43 lines · Joachim Banzhaf
Hi list,
I'd like to use LVM1 on top of DRBD 0.6.6 and not the other way round, because I then can resize my partitions online (add a new drbd device, make it a pv, add it to a vg, be happy).
It just seems not to be that simple.
The HOWTO warns about LVM not being cluster aware and describes how to do it anyway on shared storage. I (think I) have these requirements met by using heartbeat to have vg's active at one node only and running vgscan on the secondary after changes on the primary.
I created the pv's using the
/dev/nbxdevices (x=1,2). I created the vg lvm-drbd with lv lv1-s2 using these pv's.The corresponding haresources file is this:
job-vm1 192.168.1.101datadisk::lvm1datadisk::lvm2LVM::lvm-drbd \
Filesystem::/dev/lvm-drbd/lv1-s2::/ha/export::reiserfsWhat I get is lvm using the lower level device (sdbx in my case). vgdisplay -vD shows the pv's using
/dev/sdbx.
Nothing gets replicated to the other node (not surprising then). I even patchedlvm_check_dev.cand rebuilt the lvm tools to ignore/dev/sdbxdevices, removed all lvm infos from /etc and did a new vgscan and vgcfgbackup. vgdisplay -vD now shows the/dev/nbxdevices for the pv's. But still no replication without drbdsetup/dev/nbxreplicate :-(.I use suse 8.2 with suse 2.4.20-4GB kernel (you'ed a few weeks ago) for the lvm_check_dev.c-patch I installed the lvm source rpm, modified the spec file not to use the mp patches (because a file was missing), added my patchfile and did a rpm -bi
/usr/src/packages/SPECS/lvm.spec.Btw. the build process did not stop on compile errors in
lvm_check_dev.c. Is that intended? It is confusing...What am I doing wrong?
Is it possible doing LVM on top of DRBD at all?I'd happily provide more details if it helps.
Ciao,
Quoted 8 lines
Joachim Banzhaf
_______________________________________________
linux-lvm mailing list
[email protected]
http://lists.sistina.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/*** Software bugs are stupid.
Nevertheless it needs not so stupid people to solve them ***=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-=-Heinz Mauelshagen Sistina Software Inc.
Senior Consultant/Developer Am Sonnenhang 11
56242 Marienrachdorf Germany
[email protected] +49 2626 141200FAX 924446=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-=-_______________________________________________
linux-lvm mailing list
[email protected]
http://lists.sistina.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
Quoted 5 lines · Joachim Banzhaf
Am Mittwoch, 20. August 2003 12:46 schrieb Heinz J . Mauelshagen:
Quoted 1 line
Joachim,
First, thanks for your quick response, Heinz.
Quoted 8 lines
Quoted 1 line
LVM1 isn't cluster aware.
I knew that - as I stated, I read the FAQ :-).
Quoted 1 line
DRBD devices are just some other "local" ones for it.
OK, but as i stated, I used them that way. LVM1 just seems to use the lower level devices drbd works on instead. That's what's bothering me.
Ah, missed that point :(
LVM2 is your better option because it supports device name filters in a config file rather than hard-coded ones.
Quoted 3 lines
To make clear what I mean, here some details:
I have
/dev/nb1as resource lvm1 on top of/dev/sdb1in/etc/drbd.conf
<SNIP>
Quoted 26 lines
devices and used despite of pvcreate commandline options.
As I stated, to follow this hypothesis I used a patch to make lvm tools ignore the partitions/dev/sdbx.
The vgdisplay output then shows the nbx devices (even without vgscan'ning or something). But they are not used by the kernel anyway as I see no activity on/proc/drbd:-(Quoted 1 line
No replication is done by LVM1.
Yes, that's why I use drbd :-)
Quoted 5 lines
The whole replication process is up to DRBD, that's why you need to start it using a DRBD command.
You can use hartbeat to recognize if a node dies and scripts to start LVM on the living node to access logical volumes there.
I have a fully working set of linux, lvm1, heartbeat and drbd with services on top. I know how they work (from a user/admin perspective - and a bit more). And they work fine for me (including failovers of course) as long as I use drbd resources on top of lv's.
But I want to use drbd resources as pv's.
That seems not to work, because LVM1 persists in using the partition and not the drbd network block device although I configured it that way (as stated my original post).
Quoted 5 lines
Again, to clear the ground: Should it be possible at all to use pv's on top of drbd devices or am I forced to use drbd devices on top of lv's and loose things like online resize feature?
Have you - or anybody reading the list - ever sucessfully used that scenario?
I don't. List ?
Quoted 67 lines
Quoted 57 lines
Regards,
Heinz -- The LVM Guy --Quoted 43 lines · Joachim Banzhaf
Hi list,
I'd like to use LVM1 on top of DRBD 0.6.6 and not the other way round, because I then can resize my partitions online (add a new drbd device, make it a pv, add it to a vg, be happy).
It just seems not to be that simple.
The HOWTO warns about LVM not being cluster aware and describes how to do it anyway on shared storage. I (think I) have these requirements met by using heartbeat to have vg's active at one node only and running vgscan on the secondary after changes on the primary.
I created the pv's using the
/dev/nbxdevices (x=1,2). I created the vg lvm-drbd with lv lv1-s2 using these pv's.The corresponding haresources file is this:
job-vm1 192.168.1.101datadisk::lvm1datadisk::lvm2LVM::lvm-drbd \
Filesystem::/dev/lvm-drbd/lv1-s2::/ha/export::reiserfsWhat I get is lvm using the lower level device (sdbx in my case). vgdisplay -vD shows the pv's using
/dev/sdbx.
Nothing gets replicated to the other node (not surprising then). I even patchedlvm_check_dev.cand rebuilt the lvm tools to ignore/dev/sdbxdevices, removed all lvm infos from /etc and did a new vgscan and vgcfgbackup. vgdisplay -vD now shows the/dev/nbxdevices for the pv's. But still no replication without drbdsetup/dev/nbxreplicate :-(.I use suse 8.2 with suse 2.4.20-4GB kernel (you'ed a few weeks ago) for the lvm_check_dev.c-patch I installed the lvm source rpm, modified the spec file not to use the mp patches (because a file was missing), added my patchfile and did a rpm -bi
/usr/src/packages/SPECS/lvm.spec.Btw. the build process did not stop on compile errors in
lvm_check_dev.c. Is that intended? It is confusing...What am I doing wrong?
Is it possible doing LVM on top of DRBD at all?I'd happily provide more details if it helps.
Ciao,
Quoted 8 lines
Joachim Banzhaf
_______________________________________________
linux-lvm mailing list
[email protected]
http://lists.sistina.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/Quoted 8 lines
*** Software bugs are stupid.
Nevertheless it needs not so stupid people to solve them ***_______________________________________________
linux-lvm mailing list
[email protected]
http://lists.sistina.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
Quoted 5 lines
_______________________________________________
linux-lvm mailing list
[email protected]
http://lists.sistina.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
Heinz -- The LVM Guy --
*** Software bugs are stupid.
Nevertheless it needs not so stupid people to solve them ***
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Heinz Mauelshagen Sistina Software Inc.
Senior Consultant/Developer Am Sonnenhang 11
56242 Marienrachdorf Germany
[email protected] +49 2626 141200
FAX 924446
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Am Mittwoch, 20. August 2003 15:31 schrieb Heinz J . Mauelshagen:
Quoted 11 lines · Joachim Banzhaf
Quoted 6 lines
Am Mittwoch, 20. August 2003 12:46 schrieb Heinz J . Mauelshagen:
Quoted 1 line
DRBD devices are just some other "local" ones for it.
OK, but as i stated, I used them that way. LVM1 just seems to use the lower level devices drbd works on instead. That's what's bothering me.
Ah, missed that point :(
LVM2 is your better option because it supports device name filters in a config file rather than hard-coded ones.
Well, I guess I have to - and hope for the best. Since I thought I had that filter implemented in LVM1 (see attached patch) and that did not work, my expectations aren't too high...
Quoted 8 lines
Quoted 6 lines
Again, to clear the ground: Should it be possible at all to use pv's on top of drbd devices or am I forced to use drbd devices on top of lv's and loose things like online resize feature?
Have you - or anybody reading the list - ever sucessfully used that scenario?
I don't. List ?
1.0.6/tools/lib/lvm_dir_cache.with.ignore.c renamed from 1.0.6/tools/lib/lvm_dir_cache.c +95 -1
@@ -45,6 +45,7 @@* 07/07/2001 - realloc now doubles the size of the cache [JT] * 17/12/2001 - make it find loop devices again [HM] * 01/22/2002 - fix broken whole device support [HM] +* 08/18/2003 - add ignore devices feature for lvm on drbd [[email protected]] * */
@@ -52,6 +53,14 @@#include <liblvm.h> +#define IGNOREDFILE "/etc/lvmconf/ignored_devices" + +typedef struct ignored_dev { +char *name; +struct ignored_dev *next; +}ignored_dev_t ; + +static void _scan_partitions ();static void _scan_devs (int );static int _add (char *directory,char *devname);
@@ -59,12 +68,17 @@static int _alloc ();static int _is_present (dev_t rdev);static void _collapse_slashes (char *str); - +static void _read_ignored (); +static void _free_ignored (ignored_dev_t **node); +static int _ignore (char *str);static dir_cache_t *_dir_cache;static int _cache_size;static int _array_size; +static ignored_dev_t *_ignored_head =NULL ; + +/* devices *not* showing up in /proc/partitions must be scanned anyway */ static char *_noprocdir[] = {LVM_DIR_PREFIX "loop" ,
@@ -99,11 +113,13 @@ }if (!_dir_cache) { +_read_ignored ();_scan_partitions ();if (!_cache_size)_scan_devs ( TRUE);else _scan_devs ( FALSE); +_free_ignored (&_ignored_head); } *dir_cache_ptr = _dir_cache;
@@ -255,6 +271,9 @@debug_enter ("lvm_add_dir_cache -- CALLED with %s\n" , devpath); +if (_ignore (devpath)) + goto out; +if (stat (devpath, &stat_b) ==-1 ) goto out;
@@ -348,3 +367,78 @@ *str = *ptr; } + +static void _add_ignored (char *line,ignored_dev_t ***list_tail) +{ +int len; +int add =1 ; +ignored_dev_t *new_node; + + len =strlen (line); +if (line[len -1 ] =='\n' ) { + line[len -1 ] ='\0' ; + len--; + } + +debug_enter ("_add_ignored -- CALLED with %s\n" , line); + + new_node = (ignored_dev_t *)malloc (sizeof (ignored_dev_t)); +if (new_node) { + new_node->name =strdup (line); +if (new_node->name) { + new_node->next =NULL ; + **list_tail = new_node; + *list_tail = &new_node->next; + }else { +free (new_node); + add =0 ; + } + }else { + add =0 ; + } + +debug_leave ("_add_ignored '%s' -- LEAVING with ret: %s\n" , line, add ?"OK" :"ERROR" ); +} + +static void _read_ignored () +{ +FILE *f; +char line[NAME_LEN ]; +ignored_dev_t **list_tail = &_ignored_head; + +if ( (f=fopen (IGNOREDFILE ,"r" )) !=NULL ) { +while (fgets (line,sizeof (line), f)) { +if (line[0 ] !='\0' && line[0 ] !='\n' && line[0 ] !='#' ) { +_add_ignored (line, &list_tail); + } + } +fclose (f); + } +} + +static void _free_ignored (ignored_dev_t **curr) +{ +if ( *curr ) + { +_free_ignored (&(*curr)->next); +free ((*curr)->name); +free (*curr); + *curr =NULL ; + } +} + +static int _ignore (char *str) +{ +int rc =0 ; +ignored_dev_t *curr = _ignored_head; + +while (curr) { +if (!strcmp (str, curr->name)) { + rc =1 ; +break ; + } + curr = curr->next; + } +return rc; +} +
Quoted 9 lines · Joachim Banzhaf
Am Mittwoch, 20. August 2003 15:31 schrieb Heinz J . Mauelshagen:
Quoted 8 lines · Joachim Banzhaf
Quoted 6 lines
Am Mittwoch, 20. August 2003 12:46 schrieb Heinz J . Mauelshagen:
Quoted 1 line
DRBD devices are just some other "local" ones for it.
OK, but as i stated, I used them that way. LVM1 just seems to use the lower level devices drbd works on instead. That's what's bothering me.
Quoted 7 lines
Quoted 3 lines
Ah, missed that point :(
LVM2 is your better option because it supports device name filters in a config file rather than hard-coded ones.Well, I guess I have to - and hope for the best. Since I thought I had that filter implemented in LVM1 (see attached patch) and that did not work, my expectations aren't too high...
Well, what you implemented is a subset of what the LVM2 device name filters, which are regular expression based can do for you :)
Quoted 161 lines
Quoted 9 lines
Quoted 7 lines
Again, to clear the ground: Should it be possible at all to use pv's on top of drbd devices or am I forced to use drbd devices on top of lv's and loose things like online resize feature?
Have you - or anybody reading the list - ever sucessfully used that scenario?
I don't. List ?
1.0.6/tools/lib/lvm_dir_cache.with.ignore.c renamed from 1.0.6/tools/lib/lvm_dir_cache.c +95
-1@@ -45,6 +45,7 @@* 07/07/2001 - realloc now doubles the size of the cache [JT] * 17/12/2001 - make it find loop devices again [HM] * 01/22/2002 - fix broken whole device support [HM] +* 08/18/2003 - add ignore devices feature for lvm on drbd [[email protected]] * */ @@ -52,6 +53,14 @@#include <liblvm.h> +#define IGNOREDFILE "/etc/lvmconf/ignored_devices" + +typedef struct ignored_dev { +char *name; +struct ignored_dev *next; +}ignored_dev_t ; + +static void _scan_partitions ();static void _scan_devs (int );static int _add (char *directory,char *devname);@@ -59,12 +68,17 @@static int _alloc ();static int _is_present (dev_t rdev);static void _collapse_slashes (char *str); - +static void _read_ignored (); +static void _free_ignored (ignored_dev_t **node); +static int _ignore (char *str);static dir_cache_t *_dir_cache;static int _cache_size;static int _array_size; +static ignored_dev_t *_ignored_head =NULL ; + +/* devices *not* showing up in /proc/partitions must be scanned anyway */ static char *_noprocdir[] = {LVM_DIR_PREFIX "loop" ,@@ -99,11 +113,13 @@ }if (!_dir_cache) { +_read_ignored ();_scan_partitions ();if (!_cache_size)_scan_devs ( TRUE);else _scan_devs ( FALSE); +_free_ignored (&_ignored_head); } *dir_cache_ptr = _dir_cache;@@ -255,6 +271,9 @@debug_enter ("lvm_add_dir_cache -- CALLED with %s\n" , devpath); +if (_ignore (devpath)) + goto out; +if (stat (devpath, &stat_b) ==-1 ) goto out;@@ -348,3 +367,78 @@ *str = *ptr; } + +static void _add_ignored (char *line,ignored_dev_t ***list_tail) +{ +int len; +int add =1 ; +ignored_dev_t *new_node; + + len =strlen (line); +if (line[len -1 ] =='\n' ) { + line[len -1 ] ='\0' ; + len--; + } + +debug_enter ("_add_ignored -- CALLED with %s\n" , line); + + new_node = (ignored_dev_t *)malloc (sizeof (ignored_dev_t)); +if (new_node) { + new_node->name =strdup (line); +if (new_node->name) { + new_node->next =NULL ; + **list_tail = new_node; + *list_tail = &new_node->next; + }else { +free (new_node); + add =0 ; + } + }else { + add =0 ; + } + +debug_leave ("_add_ignored '%s' -- LEAVING with ret: %s\n" , line, add ?"OK" :"ERROR" ); +} + +static void _read_ignored () +{ +FILE *f; +char line[NAME_LEN ]; +ignored_dev_t **list_tail = &_ignored_head; + +if ( (f=fopen (IGNOREDFILE ,"r" )) !=NULL ) { +while (fgets (line,sizeof (line), f)) { +if (line[0 ] !='\0' && line[0 ] !='\n' && line[0 ] !='#' ) { +_add_ignored (line, &list_tail); + } + } +fclose (f); + } +} + +static void _free_ignored (ignored_dev_t **curr) +{ +if ( *curr ) + { +_free_ignored (&(*curr)->next); +free ((*curr)->name); +free (*curr); + *curr =NULL ; + } +} + +static int _ignore (char *str) +{ +int rc =0 ; +ignored_dev_t *curr = _ignored_head; + +while (curr) { +if (!strcmp (str, curr->name)) { + rc =1 ; +break ; + } + curr = curr->next; + } +return rc; +} +
Signature · 15 lines
Regards,
Heinz -- The LVM Guy --
*** Software bugs are stupid.
Nevertheless it needs not so stupid people to solve them ***
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Heinz Mauelshagen Sistina Software Inc.
Senior Consultant/Developer Am Sonnenhang 11
56242 Marienrachdorf
Germany
[email protected] +49 2626 141200
FAX 924446
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-