public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@poochiereds.net>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] fcntl.2: F_OFD_XXX needs flock64
Date: Wed, 17 Aug 2016 09:14:35 -0400	[thread overview]
Message-ID: <1471439675.3196.8.camel@poochiereds.net> (raw)
In-Reply-To: <20160817115318.GB10343@rei.lan>

On Wed, 2016-08-17 at 13:53 +0200, Cyril Hrubis wrote:
> Hi!
> > 
> > Thanks, I think I understand now. I think there are a couple of
> > potential fixes...
> > 
> > The simplest thing is to do what you're suggesting and simply
> > document
> > that F_OFD_* locks require large file offsets. If we do that
> > though,
> > then I think we also ought to do something to ensure that the build
> > breaks if you try to use F_OFD_* commands without large offsets.
> > 
> > The simplest way would be to put the F_OFD_* constant definitions
> > under
> > "#ifdef??__USE_FILE_OFFSET64", but I'm open to suggestions that
> > would
> > make the compiler error out with a more helpful error message.
> 
> Hmm, I do not think that this is a good idea. The usuall way how to
> handle missing constants are fallback definitions such as:
> 
> #ifndef F_OFD_FOO
> # define F_OFD_FOO xyz
> #endif
> 
> This wouldn't do much.
> 
> Also these should be only disable on 32bit if __USE_FILE_OFFSET64 is
> not
> defined. But you likely meant that here.
> 

That's the usual way, but in this case we wouldn't have a fallback
constant. You'd just get an error about F_OFD_* being undefined at
build time, which I think is what we'd want here. It's better to fail
to compile than to build a binary that passes a bogus struct into the
kernel.

> > The other option would be to fix glibc and the kernel to handle
> > legacy
> > struct flock with F_OFD_ cmd values. That would mean adding
> > F_OFD_*64
> > command values and fixing glibc to swap them in appropriately.
> > That's
> > doable, but I'm not sure it's really worth it. We'd also have to
> > think
> > about how to handle the old kernel/new glibc case (and vice versa),
> > and
> > that probably won't be trivial.
> 
> I do not think that this is worth the work either.
> 

-- 
Jeff Layton <jlayton@poochiereds.net>

  reply	other threads:[~2016-08-17 13:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-16 11:55 [LTP] [PATCH] fcntl.2: F_OFD_XXX needs flock64 Cyril Hrubis
2016-08-16 14:34 ` Cyril Hrubis
2016-08-16 20:04 ` Michael Kerrisk
2016-08-16 23:41   ` Jeff Layton
2016-08-17  1:08     ` Michael Kerrisk
2016-08-17  8:10     ` Cyril Hrubis
2016-08-17 11:44       ` Jeff Layton
2016-08-17 11:53         ` Cyril Hrubis
2016-08-17 13:14           ` Jeff Layton [this message]
2016-08-17 13:19             ` Cyril Hrubis
2016-08-17 13:34               ` Jeff Layton
2016-08-17 13:34                 ` Cyril Hrubis
2016-08-17 19:44         ` Michael Kerrisk
2016-08-17  7:44   ` Cyril Hrubis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1471439675.3196.8.camel@poochiereds.net \
    --to=jlayton@poochiereds.net \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox