All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] libmultipath:fix loop traversed partly
@ 2016-07-14 20:58 Xose Vazquez Perez
  2016-07-15  5:44 ` Hannes Reinecke
  0 siblings, 1 reply; 4+ messages in thread
From: Xose Vazquez Perez @ 2016-07-14 20:58 UTC (permalink / raw)
  To: zhang.kai , Christophe Varoqui, device-mapper development

zhang.kai wrote:

> ZTE Information Security Notice: The information contained in this mail (and any
> attachment transmitted herewith) is privileged and confidential and is intended for
> the exclusive use of the addressee(s).  If you are not an intended recipient, any
> disclosure, reproduction, distribution or other dissemination or use of the
> information contained is strictly prohibited.  If you have received this mail in
> error, please delete it and notify us immediately.

That kind of confidentiality notice is not welcome in a *public mailing list* ,
and even worse in a patch for a *free-software* project.

Tell your sysadmins/managers/... that it must be _removed_.


Thank you.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] libmultipath:fix loop traversed partly
  2016-07-14 20:58 [PATCH] libmultipath:fix loop traversed partly Xose Vazquez Perez
@ 2016-07-15  5:44 ` Hannes Reinecke
  0 siblings, 0 replies; 4+ messages in thread
From: Hannes Reinecke @ 2016-07-15  5:44 UTC (permalink / raw)
  To: Xose Vazquez Perez; +Cc: dm-devel

On 07/14/2016 10:58 PM, Xose Vazquez Perez wrote:
> zhang.kai wrote:
> 
>> ZTE Information Security Notice: The information contained in this mail (and any
>> attachment transmitted herewith) is privileged and confidential and is intended for
>> the exclusive use of the addressee(s).  If you are not an intended recipient, any
>> disclosure, reproduction, distribution or other dissemination or use of the
>> information contained is strictly prohibited.  If you have received this mail in
>> error, please delete it and notify us immediately.
> 
> That kind of confidentiality notice is not welcome in a *public mailing list* ,
> and even worse in a patch for a *free-software* project.
> 
> Tell your sysadmins/managers/... that it must be _removed_.
> 
C'mon.
It's not his fault that the footer is in included. Some companies have
some very odd ideas about what needs to be in the footer.
(Just look at my signature :-)

And I sincerely doubt he is in any position to influence that.

Just ignore it if you don't like it.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] libmultipath:fix loop traversed partly
  2016-07-14 12:09 zhang.kai16
@ 2016-07-22  9:44 ` Christophe Varoqui
  0 siblings, 0 replies; 4+ messages in thread
From: Christophe Varoqui @ 2016-07-22  9:44 UTC (permalink / raw)
  To: zhang.kai16; +Cc: device-mapper development, tang.junhui, christophe varoqui


[-- Attachment #1.1: Type: text/plain, Size: 2272 bytes --]

Your fix is now merged.
Thanks.

On Thu, Jul 14, 2016 at 2:09 PM, <zhang.kai16@zte.com.cn> wrote:

> From: "zhang.kai" <zhang.kai16@zte.com.cn>
>
> Problem:
> With each iteration of the vector_foreach_slot() loop statement,
> some slots couldn't be traversed when a slot is deleted from vector.
>
> Reasons:
> Currently,loop's index 'i' is not decremented correspondingly when a slot
> is
> deleted from vector.Meanwhile, in the vector_foreach_slot() loop, mpp is
> assigned
> from vector newmp directly, so find_slot() could be omitted.
>
> Signed-off-by: zhang.kai <zhang.kai16@zte.com.cn>
> ---
>  libmultipath/configure.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/libmultipath/configure.c b/libmultipath/configure.c
> index a9b9cf0..c06a3df 100644
> --- a/libmultipath/configure.c
> +++ b/libmultipath/configure.c
> @@ -924,16 +924,14 @@ coalesce_paths (struct vectors * vecs, vector newmp,
> char * refwwid, int force_r
>         if (newmp) {
>                 vector_foreach_slot (newmp, mpp, i) {
>                         char alias[WWID_SIZE];
> -                       int j;
>
>                         if (!deadmap(mpp))
>                                 continue;
>
>                         strncpy(alias, mpp->alias, WWID_SIZE - 1);
>
> -                       if ((j = find_slot(newmp, (void *)mpp)) != -1)
> -                               vector_del_slot(newmp, j);
> -
> +                       vector_del_slot(newmp, i);
> +                       i--;
>                         remove_map(mpp, vecs, 0);
>
>                         if (dm_flush_map(alias))
> --
> 2.8.1.windows.1
>
> --------------------------------------------------------
> ZTE Information Security Notice: The information contained in this mail
> (and any attachment transmitted herewith) is privileged and confidential
> and is intended for the exclusive use of the addressee(s).  If you are not
> an intended recipient, any disclosure, reproduction, distribution or other
> dissemination or use of the information contained is strictly prohibited.
> If you have received this mail in error, please delete it and notify us
> immediately.
>
> --
> dm-devel mailing list
> dm-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel
>

[-- Attachment #1.2: Type: text/html, Size: 3197 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] libmultipath:fix loop traversed partly
@ 2016-07-14 12:09 zhang.kai16
  2016-07-22  9:44 ` Christophe Varoqui
  0 siblings, 1 reply; 4+ messages in thread
From: zhang.kai16 @ 2016-07-14 12:09 UTC (permalink / raw)
  To: christophe varoqui; +Cc: zhang.kai, dm-devel, tang.junhui

From: "zhang.kai" <zhang.kai16@zte.com.cn>

Problem:
With each iteration of the vector_foreach_slot() loop statement,
some slots couldn't be traversed when a slot is deleted from vector.

Reasons:
Currently,loop's index 'i' is not decremented correspondingly when a slot is
deleted from vector.Meanwhile, in the vector_foreach_slot() loop, mpp is assigned
from vector newmp directly, so find_slot() could be omitted.

Signed-off-by: zhang.kai <zhang.kai16@zte.com.cn>
---
 libmultipath/configure.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/libmultipath/configure.c b/libmultipath/configure.c
index a9b9cf0..c06a3df 100644
--- a/libmultipath/configure.c
+++ b/libmultipath/configure.c
@@ -924,16 +924,14 @@ coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid, int force_r
 	if (newmp) {
 		vector_foreach_slot (newmp, mpp, i) {
 			char alias[WWID_SIZE];
-			int j;
 
 			if (!deadmap(mpp))
 				continue;
 
 			strncpy(alias, mpp->alias, WWID_SIZE - 1);
 
-			if ((j = find_slot(newmp, (void *)mpp)) != -1)
-				vector_del_slot(newmp, j);
-
+			vector_del_slot(newmp, i);
+			i--;
 			remove_map(mpp, vecs, 0);
 
 			if (dm_flush_map(alias))
-- 
2.8.1.windows.1

--------------------------------------------------------
ZTE Information Security Notice: The information contained in this mail (and any attachment transmitted herewith) is privileged and confidential and is intended for the exclusive use of the addressee(s).  If you are not an intended recipient, any disclosure, reproduction, distribution or other dissemination or use of the information contained is strictly prohibited.  If you have received this mail in error, please delete it and notify us immediately.

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-07-22  9:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-14 20:58 [PATCH] libmultipath:fix loop traversed partly Xose Vazquez Perez
2016-07-15  5:44 ` Hannes Reinecke
  -- strict thread matches above, loose matches on Subject: below --
2016-07-14 12:09 zhang.kai16
2016-07-22  9:44 ` Christophe Varoqui

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.