Whamcloud - gitweb
Branch HEAD
authorjohann <johann>
Tue, 3 Mar 2009 13:58:36 +0000 (13:58 +0000)
committerjohann <johann>
Tue, 3 Mar 2009 13:58:36 +0000 (13:58 +0000)
b=18374
i=adilger
i=shadow

use memmove instead of memcpy when shrinking the reply since the two memory
areas can overlap.

lustre/ptlrpc/pack_generic.c

index ce2e237..93168eb 100644 (file)
@@ -439,7 +439,7 @@ int lustre_shrink_msg_v2(struct lustre_msg_v2 *msg, int segment,
                 newpos = lustre_msg_buf_v2(msg, segment + 1, 0);
                 LASSERT(newpos <= tail);
                 if (newpos != tail)
-                        memcpy(newpos, tail, tail_len);
+                        memmove(newpos, tail, tail_len);
         }
 out:
         return lustre_msg_size_v2(msg->lm_bufcount, msg->lm_buflens);