From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de ([195.135.220.15]:51322 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1948244AbcHROLs (ORCPT ); Thu, 18 Aug 2016 10:11:48 -0400 Date: Thu, 18 Aug 2016 16:06:22 +0200 From: Cyril Hrubis To: Jeff Layton 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 Message-ID: <20160818140621.GA31207@rei.suse.cz> References: <1471521804-4291-1-git-send-email-jlayton@redhat.com> <20160818132404.GA26222@rei.suse.cz> <1471528472.2504.9.camel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1471528472.2504.9.camel@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: > > 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. Ah, we call the sys_fcntl() with these from the compat code supposedly so that it does all the checks we omit in the compat variant. Then it's needed and confusing at the same time. We do convert_fcntl_cmd() for the 64bit variants already, maybe we can just add the 32bit variants to the switch there as well. I'm not sure if it is worth of the code size increase though. > 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. I guess that this is fine for quick fix. Cleanup of the code would be nice, it's quite a maze as it is. -- Cyril Hrubis chrubis@suse.cz