From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42222) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqfA4-0000d0-9l for qemu-devel@nongnu.org; Fri, 08 May 2015 06:05:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YqfA0-0003qu-5X for qemu-devel@nongnu.org; Fri, 08 May 2015 06:05:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57422) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yqf9z-0003qh-92 for qemu-devel@nongnu.org; Fri, 08 May 2015 06:05:35 -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 (8.14.4/8.14.4) with ESMTP id t48A5XDS032421 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 8 May 2015 06:05:34 -0400 Date: Fri, 8 May 2015 11:05:32 +0100 From: Stefan Hajnoczi Message-ID: <20150508100532.GF11717@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="GLp9dJVi+aaipsRk" 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 --GLp9dJVi+aaipsRk 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(-) Reviewed-by: Stefan Hajnoczi --GLp9dJVi+aaipsRk Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVTIprAAoJEJykq7OBq3PIzigIAJ1/L2NYerJQV6zFoljbZ6KI oujEJlxaYy8z5sgWtjckrsE+wrKNH3HQi6wY6T9GIY6URtvfRUjgnQcBgwKVanFs Pxa4FWkMRlJbRVXqxlS1Y2kuGSIBg3aQWE6cLm+hu1gN7MuS05lhumVEQqiCKcLS 987jhrJmh6GWvrp2AqT8fK+EY3TVsSFX0va+rD+5kbGZ7r1gYQER8fTEOuk0H5Eb q5AFD6p3/q9mJZfSaYtY4Q1Q1pachI+D4H3w70NV/ubmgK+qQNf3317/Ec+gjtuL OQEOdGq7Se+D+NVBUFXs7jfC1dzL8fRMTdEhFhWnNagBolxoNRmJjWeZvdZCBNM= =FepY -----END PGP SIGNATURE----- --GLp9dJVi+aaipsRk--