All of lore.kernel.org
 help / color / mirror / Atom feed
* [multipath-tools] kpartx: DELETE logic question
@ 2009-06-16 12:44 Petr Uzel
  0 siblings, 0 replies; only message in thread
From: Petr Uzel @ 2009-06-16 12:44 UTC (permalink / raw)
  To: Christophe Varoqui; +Cc: dm-devel

Hi all,

In current multipath-tools, the deletion of devmappings is
done by following code snippet:

405  case DELETE:
406  for (j = n-1; j >= 0; j--) {
407    if (safe_sprintf(partname, "%s%s%d",
408             mapname, delim, j+1)) {
409       fprintf(stderr, "partname too small\n");
410       exit(1);
411    }
412    strip_slash(partname);
413  
414    if (!slices[j].size || !dm_map_present(partname))
415        continue;
416  
417    if (!dm_simplecmd(DM_DEVICE_REMOVE,
418                partname, 0)) {
419      r++;
420      continue;
421     }
422     if (verbose)
423     printf("del devmap : %s\n", partname);
424   }


I wonder what's the logic behind the test on line 414. The second part
(testing whether the mapping exists) is obvious. But what about the
first part? Why don't we want to delete mapping for partition with
size==0, i.e. partition that no longer exists in the partition table?

Suppose following scenario:
- create 3 primary partitions on dm-0
- run kpartx -a /dev/dm-0
- delete partition #2
- run kpartx -d /dev/dm-0

The result is that mapping for partition #2 is not deleted - is this
what is expected?


Thanks,


-- 
Best regards / s pozdravem

Petr Uzel, Packages maintainer
---------------------------------------------------------------------
SUSE LINUX, s.r.o.                          e-mail: puzel@suse.cz
Lihovarská 1060/12                          http://www.suse.cz
190 00 Prague 9                             
Czech Republic                              

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-06-16 12:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-16 12:44 [multipath-tools] kpartx: DELETE logic question Petr Uzel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.