Actually, I preferred your approach :)
Also, note how if ->commit_write() or ->prepare_write() return an
error, and we have already written some data, the function returns
the number of bytes written and no indication that there was an error.
According to the write(2) manpage, that's wrong.
Probably it is sufficient to make `written' a signed quantity
and to do:
out_status:
- err = written ? written : status;
+ err = status ? status : written;
I think that fixes the five or six bugs we've found so far in
this function. err.. make that six or seven. What is it trying
do if ->prepare_write() returns a non-zero, positive value?
It needs a big spring-clean. I'm afraid I don't have time to
do that for several days.
-
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/