This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [Linux PATCH] fcntl: add new F_OFD_*32 constants and handle them appropriately
- From: Cyril Hrubis <chrubis at suse dot cz>
- To: Jeff Layton <jlayton at redhat dot com>
- Cc: linux-fsdevel at vger dot kernel dot org, libc-alpha at sourceware dot org
- Date: Thu, 18 Aug 2016 15:24:04 +0200
- Subject: Re: [Linux PATCH] fcntl: add new F_OFD_*32 constants and handle them appropriately
- Authentication-results: sourceware.org; auth=none
- References: <1471521804-4291-1-git-send-email-jlayton@redhat.com>
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.
--
Cyril Hrubis
chrubis@suse.cz