From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Serge E. Hallyn" Subject: Re: [RFC v14-rc][PATCH 04/23] General infrastructure for checkpoint restart Date: Fri, 20 Mar 2009 16:24:00 -0500 Message-ID: <20090320212400.GA15946@us.ibm.com> References: <1237574868-3371-1-git-send-email-orenl@cs.columbia.edu> <1237574868-3371-5-git-send-email-orenl@cs.columbia.edu> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1237574868-3371-5-git-send-email-orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Oren Laadan Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, Dave Hansen List-Id: containers.vger.kernel.org Quoting Oren Laadan (orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org): > Changelog[v14]: > - Define sys_checkpoint(0,...) as asking for a self-checkpoint (Serge) Thanks. > - Revert use of 'pr_fmt' to avoid tainting whom includes us (Nathan Lynch) > - Explicitly indicate length of UTS fields in header > - Discard field 'h->parent' Nice. > + uts = utsname(); > + ret = cr_write_buffer(ctx, uts->release, __NEW_UTS_LEN); > + if (ret < 0) > + return ret; > + ret = cr_write_buffer(ctx, uts->version, __NEW_UTS_LEN); > + if (ret < 0) > + return ret; > + ret = cr_write_buffer(ctx, uts->machine, __NEW_UTS_LEN); ... > + /* FIX: verify compatibility of release, version and machine */ > + ret = cr_read_obj_type(ctx, uts_buf, __NEW_UTS_LEN, CR_HDR_BUFFER); > + if (ret < 0) > + goto out; > + ret = cr_read_obj_type(ctx, uts_buf, __NEW_UTS_LEN, CR_HDR_BUFFER); > + if (ret < 0) > + goto out; > + ret = cr_read_obj_type(ctx, uts_buf, __NEW_UTS_LEN, CR_HDR_BUFFER); The new_utsname fields actually have __NEW_UTS_LEN+1 chars. So if hostname happens to be full (__NEW_UTS_LEN chars plus a final null), won't you end up without the trailing null here? -serge