From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45664) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqfHf-0004bz-0A for qemu-devel@nongnu.org; Fri, 08 May 2015 06:13:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YqfHb-00071m-0t for qemu-devel@nongnu.org; Fri, 08 May 2015 06:13:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52141) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqfHa-00071d-Rs for qemu-devel@nongnu.org; Fri, 08 May 2015 06:13:26 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 930978E3D1 for ; Fri, 8 May 2015 10:13:26 +0000 (UTC) Date: Fri, 8 May 2015 11:13:24 +0100 From: Stefan Hajnoczi Message-ID: <20150508101324.GG11717@stefanha-thinkpad.redhat.com> References: <1431013548-22492-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="GUPx2O/K0ibUojHx" Content-Disposition: inline In-Reply-To: <1431013548-22492-1-git-send-email-pbonzini@redhat.com> Subject: Re: [Qemu-devel] [PATCH] block: return EPERM on writes or discards to read-only devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com --GUPx2O/K0ibUojHx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 07, 2015 at 05:45:48PM +0200, Paolo Bonzini wrote: > This is the behavior in the operating system, for example Linux's > blkdev_write_iter has the following: >=20 > if (bdev_read_only(I_BDEV(bd_inode))) > return -EPERM; >=20 > This does not apply to opening a device for read/write, when the > device only supports read-only operation. In this case any of > EACCES, EPERM or EROFS is acceptable depending on why writing is > not possible. >=20 > Signed-off-by: Paolo Bonzini > --- > block/io.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Thanks, applied to my block tree: https://github.com/stefanha/qemu/commits/block Stefan --GUPx2O/K0ibUojHx Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVTIxEAAoJEJykq7OBq3PIV1EIAKSmMv6Ll2VRW12zrGBqsTdp h62+1JtdQYs0m0yza69YOdcesSlw1SNi1EvyEd8lewULYtGsBWTIcI0wfTPW+nDE m5qsqvmtx07c0a2We9bXM6ZV1JRHVCD01XSaL0GNyVU/3zcRoJzx1/xX2qVNYJ44 YoygeB0SNLDF5hpEB261ceA/iH5tzp3fCu4WWCEs21KB7Ot9cjFpMhVCHnGZo46e vVheCIy+XT6qO4elcdZQ2xH6mbUWtg2Uqx7Nh883JrN+Otp9NubtqMi1lBJyl86Y BTEhaPO8KVcemlUIl0TSTvp2cTicvrN8ON4Hd3OWNAi20usASbIXxB5F5ioZ2B4= =wMyT -----END PGP SIGNATURE----- --GUPx2O/K0ibUojHx--