Thread (21 messages) 21 messages, 7 authors, 2017-06-09

Re: [PATCH v2] firmware: fix sending -ERESTARTSYS due to signal on fallback

flat view

From: Alan Cox <hidden>
Date: 2017-06-06 14:53:28
Also in: lkml

Possibly related (same subject, not in this thread)

"Unix tradition (and thus almost all applications) believe file store
writes to
be non signal interruptible. It would not be safe or practical to
change that
guarantee."
Yep everyone codes

	write(disk_file, "foo", 3);

not while(..) blah around it.
For these two reasons then it would seem best we do two things
actually:

1) return -EINTR instead of -EAGAIN when we detect
swait_event_interruptible_timeout()
got interrupted by a signal (it returns -ERESTARTSYS)
2) Do as you note below and add wait_event_killable_timeout()
Pedantic detail that I don't think affects you

If you have completed a part of the I/O then you should return the byte
processed count not EINTR, but -1,EINTR if no progress was made.

Alan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help