<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 6, 2015 at 11:28 PM, Pavel Emelyanov <span dir="ltr"><<a href="mailto:xemul@parallels.com" target="_blank">xemul@parallels.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 04/07/2015 08:49 AM, Andrew Vagin wrote:<br>
> On Mon, Apr 06, 2015 at 09:22:19AM -0700, Saied Kazemi wrote:<br>
>> Currently if /tmp does not exist, CRIU fails because it will not be<br>
>> able to create a temporary directory there. But when checkpointing<br>
>> and restoring containers, we cannot rely on the existence of /tmp.<br>
>> For such containers, we should use root (/). The temporary directory<br>
>> will be removed after CRIU is done.<br>
>><br>
> Acked-by: Andrew Vagin <<a href="mailto:avagin@odin.com">avagin@odin.com</a>><br>
>> Signed-off-by: Saied Kazemi <<a href="mailto:saied@google.com">saied@google.com</a>><br>
<br>
</span>Applied, thanks!<br>
<br>
I have a question though<br>
<span class=""><br>
>> @@ -803,7 +805,10 @@ static int open_mountpoint(struct mount_info *pm)<br>
>> if (switch_ns(root_item->pid.real, &mnt_ns_desc, &ns_old) < 0)<br>
>> goto out;<br>
>><br>
>> - if (mkdtemp(mnt_path) == NULL) {<br>
>> + mnt_path = mkdtemp(mnt_path_tmp);<br>
>> + if (mnt_path == NULL && errno == ENOENT)<br>
>> + mnt_path = mkdtemp(mnt_path_root);<br>
<br>
</span>What's the point in trying to go with /tmp and then falling back to /?<br>
Why not just go ahead and always mkdtemp dir in /?<br></blockquote><div><br></div><div>No "hard" reason -- mainly for compatibility with the original code as well as conforming to the practice of using /tmp for temporary stuff. There's no performance penalty unless it fails which, in practice, I think it'd be less than 1% of the cases. That said, I have no objection to always using /.</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">
>> + if (mnt_path == NULL) {<br>
>> pr_perror("Can't create a temporary directory");<br>
>> goto out;<br>
>> }<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">-- Pavel<br></font></span></blockquote><div><br></div><div>--Saied </div></div><br></div></div>