From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 99701 invoked by alias); 23 Aug 2016 11:36:26 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 99685 invoked by uid 89); 23 Aug 2016 11:36:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=nail, offsets, naked, 2016-08-23 X-HELO: mail-yw0-f172.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=JCVR2nwGq9Y4OJ6UfpDVZWmnbT9zD7g4zMDv/EZ38pU=; b=lTG1dCWdZSACH6UJ1apCDWkIzfHzlU2zgDjx5T6oUmRY/vOvi9du1LIcHyaaOtyB84 0wxwkgQt1kXKh+p0EWBR+53i4Z4l7i3BrHT31/Cw6yw09uyYNE4FWypXX//EHPubH5gS 3GsZlePUhFlImWKzHkzkkOSJAgjS894vMP0p6iy/bucDVtLqLMfnCBEkWiC9Yhlqpi5L iQ4rM9/r1v8kGy9wPkttT0wkZgVoEWK8oADLJbPYO38L5ibp8zVj8+POozlzWPV4Zmqd Y9LUu8ahX81zaIFqYd+L2sA/NdsK9DCupcPcFzWFADBHJRAY312OR9GHGhoplaGyoW9S +EJA== X-Gm-Message-State: AEkoousiZ/6s1JQ5z4XkEIX49SCw9uzbVpb6uBz3xQ4AYnjdAcVSrxElfjXe3nHxHS7nXLF1 X-Received: by 10.129.48.198 with SMTP id w189mr22529969yww.126.1471952182811; Tue, 23 Aug 2016 04:36:22 -0700 (PDT) Message-ID: <1471952179.13027.3.camel@redhat.com> Subject: Re: [glibc PATCH] fcntl: put F_OFD_* constants under #ifdef __USE_FILE_OFFSET64 From: Jeff Layton To: Cyril Hrubis , Florian Weimer Cc: Mike Frysinger , "Michael Kerrisk (man-pages)" , libc-alpha@sourceware.org, linux-fsdevel@vger.kernel.org, Carlos O'Donell , Yuriy Kolerov Date: Tue, 23 Aug 2016 11:36:00 -0000 In-Reply-To: <20160823110343.GA4962@rei.suse.cz> References: <1471445251-2450-1-git-send-email-jlayton@redhat.com> <20160817184333.GC21655@vapier.lan> <1471461304.3196.101.camel@redhat.com> <1471464343.3196.125.camel@redhat.com> <20160817203746.GF21655@vapier.lan> <1471467478.3196.143.camel@redhat.com> <20160817213522.GG21655@vapier.lan> <1471470526.3196.153.camel@redhat.com> <8e1a972a-7966-139b-9d75-6d3a847a1be8@redhat.com> <20160823110343.GA4962@rei.suse.cz> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-SW-Source: 2016-08/txt/msg00716.txt.bz2 On Tue, 2016-08-23 at 13:03 +0200, Cyril Hrubis wrote: > Hi! > > > > > > > > So yeah, I think what I proposed before would probably be fine. > > > But now > > > that Michael pushed the issue, it's dawned on me that we may be > > > able to > > > get away with supporting it better if we turn the compatability > > > mechanism on its head and use F_OFD_*32 constants in the non-LFS > > > case. > > > > That's rather confusing to programmers, though. > > > > We then have: > > > > F_OFD_SETLK     always 64-bit > > F_SETLK         32-bit or 64-bit > > F_SETLK64       always 64-bit (not recommended) > > F_OFD_SETLK32   always 32-bit > > It's even worse, the F_OFD_SETLK32 in the proposed patch behaves > exactly > as F_SETLK so it's 32-bit or 64-bit depending on sizeof(long) in the > kernel, that is because the compat fcntl64 converts struct flock from > userspace to kernel struct flock and just call sys_fcntl() with the > cmd > it has. So in the end if you call fcntl with F_OFD_SETLK32 on 64bit > kernel it expects flock64. > To be clear, that approach was NAK'ed by Christoph (and I think that's a good thing, actually -- one more nail in the non-LFS coffin). I think what we want merged into glibc is this patch that I sent late on Thursday: [glibc PATCHv2] fcntl: don't define OFD lock constants for 32-bit builds with small file offsets We'll also need your patch to the fcntl(2) manpage as well, but that's a separate problem. -- Jeff Layton