On 03/02/2015 10:22, Kevin Wolf wrote: > Paolo, I think it's rather surprising that iov_send_recv() modifies its > iov. The modification is undone at the end, so you seem to have > considered that a caller might be reusing it after and you can't "use it > up", but we still get problems with concurrent accesses.
Yes, I wasn't thinking of concurrent accesses indeed. But I wasn't the author of iov_send_recv(), I just took it from sheepdog. :) > Was it an intentional design decision that iov_send_recv() is the sole > owner of the iov and the caller must duplicate it if it's used elsewhere > concurrently? > > Otherwise I would suggest to fix iov_send_recv(), and possibly try and > make all the qiov/iov arguments in the block layer const. I agree. However, it's not a small change. I think Wen's patch is okay with a FIXME comment added. Paolo