From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934929AbbIVVpO (ORCPT ); Tue, 22 Sep 2015 17:45:14 -0400 Received: from ipmail06.adl6.internode.on.net ([150.101.137.145]:16824 "EHLO ipmail06.adl6.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934154AbbIVVpM (ORCPT ); Tue, 22 Sep 2015 17:45:12 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2A1CwBCywFWPOV8LHldgySBPYJcg32iWAEBAQEBAQaKdpEhAgIBAQKBTE0BAQEBAQEHAQEBAUE/hCUBAQQ6HCMQCAMOCgklDwUlAwcaE4gtyyoBAQgCAR8ZhhOFRIUNB4QsBZVnjQSPBIwkgnQcgWYsM4ltAQEB Date: Wed, 23 Sep 2015 07:45:07 +1000 From: Dave Chinner To: David Howells Cc: "Theodore Ts'o" , linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com, viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 1/2] VFS: Kill use of O_LARGEFILE inside the kernel Message-ID: <20150922214507.GK19114@dastard> References: <20150922155104.GA2296@thunk.org> <20150922152450.32539.55285.stgit@warthog.procyon.org.uk> <1458.1442938362@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1458.1442938362@warthog.procyon.org.uk> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 22, 2015 at 05:12:42PM +0100, David Howells wrote: > Theodore Ts'o wrote: > > > So what this means is that on 32-bit systems, if we have a userspace > > program which isn't using the Largefile-enabled, and it opens a file > > which is larger than can be addressed with a 32-bit off_t, it can get > > surprised and possibly cause data loss. > > Good point. I was initially thinking that 32-bit userspace on a 64-bit system > would have O_LARGEFILE automatically enabled - but I guess it'll trap through > the compat entry points which avoid that. > > That said, fanotify and xfs_open_by_handle() will both automatically set > O_LARGEFILE irrespectively of the 32-bitness of the original caller. Any binaries that use xfs_open_by_handle() and then don't support greater than 32bit file offsets are simply broken. No ifs or buts - if you are using low level XFS specific file access ioctls, you need to build binaries that support 64 bit offsets. Cheers, Dave. -- Dave Chinner david@fromorbit.com