Received: from eggs.gnu.org ([2001:4830:134:3::10]:49813) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VRPPw-000652-G9 for qemu-devel@nongnu.org; Wed, 02 Oct 2013 12:36:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VRPPq-0000ig-H5 for qemu-devel@nongnu.org; Wed, 02 Oct 2013 12:36:52 -0400 Message-ID: <524C4B9D.5000100@msgid.tls.msk.ru> Date: Wed, 02 Oct 2013 20:36:45 +0400 From: Michael Tokarev MIME-Version: 1.0 References: <1380626897-500-1-git-send-email-berrange@redhat.com> In-Reply-To: <1380626897-500-1-git-send-email-berrange@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [Qemu-trivial] [PATCH] hw/9pfs: Fix errno value for xattr functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org, Anthony Liguori , "Aneesh Kumar K.V" 01.10.2013 15:28, Daniel P. Berrange =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > From: "Daniel P. Berrange" > > If there is no operation driver for the xattr type the > functions return '-1' and set errno to '-EOPNOTSUPP'. > When the calling code sets 'ret =3D -errno' this turns > into a large positive number. > > In Linux 3.11, the kernel has switched to using 9p > version 9p2000.L, instead of 9p2000.u, which enables > support for xattr operations. This on its own is harmless, > but for another change which makes it request the xattr > with a name 'security.capability'. > > The result is that the guest sees a succesful return > of 95 bytes of data, instead of a failure with errno > set to 95. Since the kernel expects a maximum of 20 > bytes for an xattr return this gets translated to the > unexpected errno ERANGE. > > This all means that when running a binary off a 9p fs > in 3.11 kernels you get a fun result of: > > # ./date > sh: ./date: Numerical result out of range > > The only workaround is to pass 'version=3D9p2000.u' when > mounting the 9p fs in the guest, to disable all use of > xattrs. Thanks, applied to the trivial patches queue. /mjt