xfs
[Top] [All Lists]

Re: [RFC PATCH 1/2] VFS: Kill use of O_LARGEFILE inside the kernel

To: David Howells <dhowells@xxxxxxxxxx>
Subject: Re: [RFC PATCH 1/2] VFS: Kill use of O_LARGEFILE inside the kernel
From: Theodore Ts'o <tytso@xxxxxxx>
Date: Tue, 22 Sep 2015 15:25:27 -0400
Cc: viro@xxxxxxxxxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=thunk.org; s=ef5046eb; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=VSqQmBgWaYDlOJbjDHDiKmM2qqury2uzKP+XR/WK5l8=; b=pNkmNV9Za6GAbU0Dvv8Shd8Go01nMmnvvqe/N59SBby98+cBPzyDixZauUUm6Z+H5h7wHaJ3Y05P3VN74Z8GBz5OIh7YeQoHZFlYHzH6Ex6yYt8X4pG8n5w+Z5aB8w7eolJlMVmELcsKIOOFt9njLeFqnKza1X4rntwMm+8Xcuk=;
In-reply-to: <1458.1442938362@xxxxxxxxxxxxxxxxxxxxxx>
Mail-followup-to: Theodore Ts'o <tytso@xxxxxxx>, David Howells <dhowells@xxxxxxxxxx>, viro@xxxxxxxxxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx
References: <20150922155104.GA2296@xxxxxxxxx> <20150922152450.32539.55285.stgit@xxxxxxxxxxxxxxxxxxxxxx> <1458.1442938362@xxxxxxxxxxxxxxxxxxxxxx>
User-agent: Mutt/1.5.23 (2014-03-12)
On Tue, Sep 22, 2015 at 05:12:42PM +0100, David Howells wrote:
> 
> Further, path-based truncate() makes no checks based on file-largeness, unlike
> ftruncate().

Right, but truncate in general is used to make files *smaller* so I'm
having trouble thinking of a scenario where a largefile-oblivious
program could get in trouble by truncating a file > 2TB to some
hard-coded length (normally zero).

> Overlayfs and one or two other places need to potentially apply O_LARGEFILE to
> the things that they do on behalf of userspace - but other than suppressing
> some size checks, it seems to be ignored by the filesystems and the VM.

The size checks really were the primary points of O_LARGEFILE.  As I
recall the primary system calls where this really matters is open(2)
and stat(2) (since if st_size is too small to represent the size of
the file, then the user space program could get really confused).

Essentially O_LARGEFILE is an assertion that userspace can handle
handle 64-bit files, and won't get confused by system call interfaces
where off_t is 32-bit wide, because it will use the 64-bit variants.
So it's not at all surprising that the file systems and the VM in
general doesn't need to worry about the flag.

                                      - Ted

<Prev in Thread] Current Thread [Next in Thread>