linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@redhat.com>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: linux-fsdevel@vger.kernel.org, libc-alpha@sourceware.org
Subject: Re: [Linux PATCH] fcntl: add new F_OFD_*32 constants and handle them appropriately
Date: Thu, 18 Aug 2016 09:54:32 -0400	[thread overview]
Message-ID: <1471528472.2504.9.camel@redhat.com> (raw)
In-Reply-To: <20160818132404.GA26222@rei.suse.cz>

On Thu, 2016-08-18 at 15:24 +0200, Cyril Hrubis wrote:
> Hi!
> > 
> > diff --git a/fs/fcntl.c b/fs/fcntl.c
> > index 350a2c8cfd28..71704aa11170 100644
> > --- a/fs/fcntl.c
> > +++ b/fs/fcntl.c
> > @@ -270,6 +270,7 @@ static long do_fcntl(int fd, unsigned int cmd, unsigned long arg,
> > > >  	/* 32-bit arches must use fcntl64() */
> > > >  	case F_OFD_GETLK:
> >  #endif
> > > > +	case F_OFD_GETLK32:
> > > >  	case F_GETLK:
> > > >  		err = fcntl_getlk(filp, cmd, (struct flock __user *) arg);
> > > >  		break;
> > @@ -278,7 +279,8 @@ static long do_fcntl(int fd, unsigned int cmd, unsigned long arg,
> > > >  	case F_OFD_SETLK:
> > > >  	case F_OFD_SETLKW:
> >  #endif
> > > > -		/* Fallthrough */
> > > > +	case F_OFD_SETLK32:
> > > > +	case F_OFD_SETLKW32:
> > > >  	case F_SETLK:
> > > >  	case F_SETLKW:
> > > >  		err = fcntl_setlk(fd, filp, cmd, (struct flock __user *) arg);
> 
> Shouldn't we do #if BITS_PER_LONG == 32 around the newly added cases?
> 
> Since otherwise fcntl() with cmd F_OFD_SETLK32 would expect 64bit off_t
> on 64 bit kernel. It will probably never be used that way, but I find it
> quite confusing.
> 
> The rest looks good to me.
> 

No, 64 bit machines still need these for the compat syscall case.
Consider someone running a 32-bit, non-LFS binary on a 64-bit host.

Unfortunately, the way this has changed over the decades is just really
hard to follow. Eventually we ought to do a cleanup of this code to
make it simpler, but I'd really like this patch to be applicable to
stable kernels, so I think we ought to wait on that until later.

-- 
Jeff Layton <jlayton@redhat.com>

  reply	other threads:[~2016-08-18 13:54 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-18 12:03 [Linux PATCH] fcntl: add new F_OFD_*32 constants and handle them appropriately Jeff Layton
2016-08-18 13:24 ` Cyril Hrubis
2016-08-18 13:54   ` Jeff Layton [this message]
2016-08-18 14:06     ` Cyril Hrubis
2016-08-18 17:05 ` Christoph Hellwig
2016-08-18 17:28   ` Jeff Layton
2016-08-18 17:31     ` Christoph Hellwig
2016-08-18 17:46       ` Mike Frysinger
2016-08-18 17:52         ` Christoph Hellwig
2016-08-18 18:16           ` Mike Frysinger
2016-08-18 19:01           ` Zack Weinberg
2016-08-18 19:36             ` Paul Eggert
2016-08-19 13:20               ` Zack Weinberg
2016-08-19 15:02                 ` Joseph Myers
2016-08-19 15:45                   ` Zack Weinberg
2016-08-19 16:58                     ` Joseph Myers
2016-08-19 19:50                       ` Zack Weinberg
2016-08-18 20:52             ` Joseph Myers
2016-08-25 11:53       ` Florian Weimer
2016-08-25 12:05         ` 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=1471528472.2504.9.camel@redhat.com \
    --to=jlayton@redhat.com \
    --cc=chrubis@suse.cz \
    --cc=libc-alpha@sourceware.org \
    --cc=linux-fsdevel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).