<div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_extra"><div class="gmail_quote">Cyril Hrubis <span dir="ltr"><<a href="mailto:chrubis@suse.cz" target="_blank">chrubis@suse.cz</a>></span> wrote:</div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
</span>I've tried the test with this patch applied and I still got soft-lockup<br>
on unpatched kernel, so it seems like the reproducer works fine with<br>
these changes.<div><div class="h5">
> <br>
> - if (tcsetattr(ptmx, TCSANOW, &io) != 0)<br>
> - tst_brk(TBROK | TERRNO, "tcsetattr() failed");<br>
> + if (tcgetattr(ptmx, &io) != 0)<br>
> + tst_brk(TBROK | TERRNO, "tcgetattr() failed");<br>
> +<br>
> + io.c_lflag = EXTPROC | ICANON;<br>
> +<br>
> + TEST(tcsetattr(ptmx, TCSANOW, &io));<br>
> + if (TEST_RETURN == -1) {<br>
> + if (TEST_ERRNO == EINVAL)<br>
> + tst_res(TCONF, "tcsetattr(, , EXTPROC | ICANON) is not supported");<br>
> + else<br>
> + tst_brk(TBROK | TERRNO, "tcsetattr() failed");<br>
> + }<br>
<br>
</div></div>We changed the TEST_RETURN to TST_RET and TEST_ERRNO to TST_ERR a few<br>
weeks ago, can you please update you git tree?<br></blockquote><div> </div><div class="gmail_default" style="font-size:small">Yes, sure.</div><div class="gmail_default" style="font-size:small"></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class=""><br>
> if (unlockpt(ptmx) != 0)<br>
> tst_brk(TBROK | TERRNO, "unlockpt() failed");<br>
> <br>
> pts = SAFE_OPEN(ptsname(ptmx), O_RDONLY);<br>
> SAFE_WRITE(1, ptmx, &c, 1);<br>
> + /* giving newline('\n') to ptmx to avoid reading pts block */<br>
> + SAFE_WRITE(1, ptmx, &n, 1);<br>
<br>
</span>I wonder if we can just do SAFE_WRITE(1, ptmx, "A\n", 2) here instead?<br></blockquote><div><br></div><div class="gmail_default" style="font-size:small">I think yes, and this is more tidy.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Also the comment is a bit misleading, I was thinking for a while about<br>
what is pts block and why do we need to avoid reading it. So maybe we<br>
should reword it as:<br>
<br>
/* write newline to ptmx to avoid read() on pts to block */<br></blockquote><div> </div><div><div class="gmail_default" style="font-size:small">Ok, it will be updated in patch v2.</div></div></div><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div>
</div></div>