From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HTLUo-0002PD-Bs for qemu-devel@nongnu.org; Mon, 19 Mar 2007 13:18:10 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HTLUm-0002On-AE for qemu-devel@nongnu.org; Mon, 19 Mar 2007 13:18:09 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HTLUm-0002Ok-46 for qemu-devel@nongnu.org; Mon, 19 Mar 2007 12:18:08 -0500 Received: from phoenix.bawue.net ([193.7.176.60] helo=mail.bawue.net) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HTLTI-00039S-9o for qemu-devel@nongnu.org; Mon, 19 Mar 2007 13:16:36 -0400 Date: Mon, 19 Mar 2007 17:13:03 +0000 Subject: Re: [Qemu-devel] [PATCH] fcntl64 fix Message-ID: <20070319171303.GE28895@networkno.de> References: <20070309215335.GB5629@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070309215335.GB5629@localhost.localdomain> From: Thiemo Seufer Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Kirill A. Shutemov" Cc: qemu-devel@nongnu.org Kirill A. Shutemov wrote: > TARGET_F_*64 should be used instead of F_*64, because on 64-bit host > systems F_GETLK == F_GETLK64(same for SETLK and SETLKW), so we cannot > determinate if it's a long lock or not on a target 32-bit system. > Patch in the attachment. > > P.S. Please, review my privious patches, which I have added description > recently. Or should I repost it? > > diff -uNr qemu-0.9.0.cvs20070304.orig/linux-user/syscall.c qemu-0.9.0.cvs20070304/linux-user/syscall.c > --- qemu-0.9.0.cvs20070304.orig/linux-user/syscall.c 2007-03-09 20:08:59 +0200 > +++ qemu-0.9.0.cvs20070304/linux-user/syscall.c 2007-03-09 20:09:54 +0200 > @@ -4063,7 +4063,7 @@ > #endif > > switch(arg2) { > - case F_GETLK64: > + case TARGET_F_GETLK64: > ret = get_errno(fcntl(arg1, arg2, &fl)); This changes the bug from checking the wrong flag to (potentially) passing down the wrong flag... > if (ret == 0) { > #ifdef TARGET_ARM > @@ -4089,8 +4089,8 @@ > } > break; > > - case F_SETLK64: > - case F_SETLKW64: > + case TARGET_F_SETLK64: > + case TARGET_F_SETLKW64: > #ifdef TARGET_ARM > if (((CPUARMState *)cpu_env)->eabi) { > lock_user_struct(target_efl, arg3, 1); Likewise here. We should always check TARGET_* flags and pass down the corresponding host flag. Thiemo