in do_write() we are retrying sys_write again with remaining 100 bytes
new instance of syswrite is called with 100 bytes string
total_written is 0
write_nonblock is called with 100 bytes string
write_nonblock writes 100 bytes
written and total_written are now 100
syswrite returns result 100 instead of 300 to do_write
Looking at FIXME in syswrite i think maybe all this code should be refactored but I wanted my fix to be as small as possible. Also I don't know how to implement unittest for this bug so it's up to you.
Imaginary test:
Looking at FIXME in syswrite i think maybe all this code should be refactored but I wanted my fix to be as small as possible. Also I don't know how to implement unittest for this bug so it's up to you.