From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39882) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIbF6-0007j6-5q for qemu-devel@nongnu.org; Tue, 03 Feb 2015 06:02:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YIbF2-0004JP-0m for qemu-devel@nongnu.org; Tue, 03 Feb 2015 06:02:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42729) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIbF1-0004IQ-QI for qemu-devel@nongnu.org; Tue, 03 Feb 2015 06:01:59 -0500 Message-ID: <54D0AA9D.7040404@redhat.com> Date: Tue, 03 Feb 2015 12:01:49 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <54CB3BB4.80406@cn.fujitsu.com> <20150130133955.GB24537@noname.redhat.com> <54CED08C.2080501@cn.fujitsu.com> <20150203092153.GA4488@noname.redhat.com> In-Reply-To: <20150203092153.GA4488@noname.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH] quorum: don't share qiov List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , Wen Congyang Cc: qemu-devl , Stefan Hajnoczi 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