[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <49106B0A.8010205@cs.columbia.edu>
Date: Tue, 04 Nov 2008 10:32:26 -0500
From: Oren Laadan <orenl@...columbia.edu>
To: Masahiko Takahashi <m-takahashi@...jp.nec.com>
CC: Linus Torvalds <torvalds@...l.org>, linux-api@...r.kernel.org,
containers@...ts.linux-foundation.org,
linux-kernel@...r.kernel.org,
Dave Hansen <dave@...ux.vnet.ibm.com>, linux-mm@...ck.org,
Alexander Viro <viro@...iv.linux.org.uk>,
"H. Peter Anvin" <hpa@...or.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...e.hu>
Subject: Re: [RFC v8][PATCH 05/12] x86 support for checkpoint/restart
Masahiko Takahashi wrote:
> Hi Oren,
>
> I'm now trying to port your patchset to x86_64, and find a tiny
> inconsistency issue.
>
>
> On 2008-10-30 at 09:51 -0400, Oren Laadan wrote:
>> +/* dump the thread_struct of a given task */
>> +int cr_write_thread(struct cr_ctx *ctx, struct task_struct *t)
>> +{
>> + struct cr_hdr h;
>> + struct cr_hdr_thread *hh = cr_hbuf_get(ctx, sizeof(*hh));
>> + struct thread_struct *thread;
>> + struct desc_struct *desc;
>> + int ntls = 0;
>> + int n, ret;
>> +
>> + h.type = CR_HDR_THREAD;
>> + h.len = sizeof(*hh);
>> + h.parent = task_pid_vnr(t);
>> +
>> + thread = &t->thread;
>> +
>> + /* calculate no. of TLS entries that follow */
>> + desc = thread->tls_array;
>> + for (n = GDT_ENTRY_TLS_ENTRIES; n > 0; n--, desc++) {
>> + if (desc->a || desc->b)
>> + ntls++;
>> + }
>> +
>> + hh->gdt_entry_tls_entries = GDT_ENTRY_TLS_ENTRIES;
>> + hh->sizeof_tls_array = sizeof(thread->tls_array);
>> + hh->ntls = ntls;
>> +
>> + ret = cr_write_obj(ctx, &h, hh);
>> + cr_hbuf_put(ctx, sizeof(*hh));
>> + if (ret < 0)
>> + return ret;
>
> Please add
> if (ntls == 0)
> return ret;
> because, in restart phase, reading TLS entries from the image file
> is skipped if hh->ntls == 0, which may incur inconsistency and fail
> to restart.
>
Will fix, thanks.
Oren.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists