public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: David Chinner <dgc@sgi.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: David Chinner <dgc@sgi.com>,
	"Amit K. Arora" <aarora@linux.vnet.ibm.com>,
	torvalds@linux-foundation.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org,
	xfs@oss.sgi.com, suparna@in.ibm.com, cmm@us.ibm.com
Subject: Re: [PATCH 1/5] fallocate() implementation in i86, x86_64 and powerpc
Date: Fri, 4 May 2007 17:27:42 +1000	[thread overview]
Message-ID: <20070504072742.GK32602149@melbourne.sgi.com> (raw)
In-Reply-To: <20070503232815.2f62a75e.akpm@linux-foundation.org>

On Thu, May 03, 2007 at 11:28:15PM -0700, Andrew Morton wrote:
> On Fri, 4 May 2007 16:07:31 +1000 David Chinner <dgc@sgi.com> wrote:
> > On Thu, May 03, 2007 at 09:29:55PM -0700, Andrew Morton wrote:
> > > On Thu, 26 Apr 2007 23:33:32 +0530 "Amit K. Arora" <aarora@linux.vnet.ibm.com> wrote:
> > > 
> > > > This patch implements the fallocate() system call and adds support for
> > > > i386, x86_64 and powerpc.
> > > > 
> > > > ...
> > > > +{
> > > > +	struct file *file;
> > > > +	struct inode *inode;
> > > > +	long ret = -EINVAL;
> > > > +
> > > > +	if (len == 0 || offset < 0)
> > > > +		goto out;
> > > 
> > > The posix spec implies that negative `len' is permitted - presumably "allocate
> > > ahead of `offset'".  How peculiar.
> > 
> > I just checked the man page for posix_fallocate() and it says:
> > 
> >       EINVAL  offset or len was less than zero.
> > 
> > We should probably follow this lead.
> 
> Yes, I think so.  I'm suspecting that
> http://www.opengroup.org/onlinepubs/009695399/functions/posix_fallocate.html
> is just buggy.  Or I can't read.
> 
> I mean, if we're going to support negative `len' then is the byte at
> `offset' inside or outside the segment?  Head spins.

I don't think we should care. If we provide a syscall with the
semantics of "allocate from offset to offset+len" then glibc's
implementation can turn negative length into two separate
fallocate syscalls....

> > > > +	ret = -ENODEV;
> > > > +	if (!S_ISREG(inode->i_mode))
> > > > +		goto out_fput;
> > > 
> > > So we return ENODEV against an S_ISBLK fd, as per the posix spec.  That
> > > seems a bit silly of them.
> > 
> > Hmmmm - I thought that the intention of sys_fallocate() was to
> > be generic enough to eventually allow preallocation on directories.
> > If that is the case, then this check will prevent that....
> 
> The above opengroup page only permits S_ISREG.  Preallocating directories
> sounds quite useful to me, although it's something which would be pretty
> hard to emulate if the FS doesn't support it.  And there's a decent case to
> be made for emulating it - run-anywhere reasons.  Does glibc emulation support
> directories?  Quite unlikely.
> 
> But yes, sounds like a desirable thing.  Would XFS support it easily if the above
> check was relaxed?

No - right now empty blocks are pruned from the directory immediately so I
don't think we really have a concept of empty blocks in the btree structure.
dir2 is bloody complex, so adding preallocation is probably not going to
be simple to do.

It's not high on my list to add, either, because we can typically avoid the
worst case directory fragmentation by using larger directory block sizes
(e.g. 16k instead of the default 4k on a 4k block size fs).

IIRC directory preallocation has been talked about more for ext3/4....

Cheers,

Dave.
-- 
Dave Chinner
Principal Engineer
SGI Australian Software Group

  parent reply	other threads:[~2007-05-04  7:28 UTC|newest]

Thread overview: 223+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20070117094658.GA17390@amitarora.in.ibm.com>
     [not found] ` <20070225022326.137b4875.akpm@linux-foundation.org>
     [not found]   ` <20070301183445.GA7911@amitarora.in.ibm.com>
2007-03-16 14:31     ` [RFC][PATCH] sys_fallocate() system call Amit K. Arora
2007-03-16 15:21       ` Heiko Carstens
2007-03-19  9:24         ` Amit K. Arora
2007-03-19 11:23           ` Heiko Carstens
2007-03-16 16:17       ` Heiko Carstens
2007-03-17  9:59         ` Paul Mackerras
2007-03-17 11:07           ` Matthew Wilcox
2007-03-17 14:30             ` Heiko Carstens
2007-03-17 14:38               ` Stephen Rothwell
2007-03-17 14:42                 ` Stephen Rothwell
2007-03-17 11:10         ` Matthew Wilcox
2007-03-21 12:04           ` Amit K. Arora
2007-03-21 21:35             ` Chris Wedgwood
2007-03-29 11:51             ` Interface for the new fallocate() " Amit K. Arora
2007-03-29 16:35               ` Chris Wedgwood
2007-03-29 17:01               ` Jan Engelhardt
2007-03-29 17:18                 ` linux-os (Dick Johnson)
2007-03-29 18:05                   ` Jan Engelhardt
2007-03-29 18:37                     ` Linus Torvalds
2007-03-30  7:00                 ` Heiko Carstens
2007-03-29 17:10               ` Andrew Morton
2007-03-30  7:14                 ` Jakub Jelinek
2007-03-30  8:39                   ` Heiko Carstens
2007-03-30  9:15                   ` Paul Mackerras
2007-04-05 11:26                   ` Amit K. Arora
2007-04-05 11:44                     ` Amit K. Arora
2007-04-05 15:50                     ` Randy Dunlap
2007-04-06  9:58                     ` Andreas Dilger
2007-04-17 12:55                   ` Amit K. Arora
2007-04-18 13:06                     ` Andreas Dilger
2007-04-20 13:51                       ` Amit K. Arora
2007-04-20 14:59                         ` Jakub Jelinek
2007-04-24 12:16                           ` Amit K. Arora
2007-04-26 17:50                             ` [PATCH 0/5] fallocate " Amit K. Arora
2007-04-26 18:03                               ` [PATCH 1/5] fallocate() implementation in i86, x86_64 and powerpc Amit K. Arora
2007-05-04  4:29                                 ` Andrew Morton
2007-05-04  4:41                                   ` Paul Mackerras
2007-05-09 10:15                                     ` Suparna Bhattacharya
2007-05-09 10:50                                       ` Paul Mackerras
2007-05-09 11:10                                         ` Suparna Bhattacharya
2007-05-09 11:37                                           ` Paul Mackerras
2007-05-09 12:00                                             ` Martin Schwidefsky
2007-05-09 12:05                                             ` Amit K. Arora
2007-05-04  4:55                                   ` Andrew Morton
2007-05-04  6:07                                   ` David Chinner
2007-05-04  6:28                                     ` Andrew Morton
2007-05-04  6:56                                       ` Jakub Jelinek
2007-05-07 13:08                                         ` Ulrich Drepper
2007-05-04  7:27                                       ` David Chinner [this message]
2007-05-07 11:10                                       ` Amit K. Arora
2007-05-07 11:03                                   ` Amit K. Arora
2007-05-09 16:01                                 ` Amit K. Arora
2007-05-09 16:54                                   ` Andreas Dilger
2007-05-09 17:07                                   ` Mingming Cao
2007-05-10  0:59                                   ` David Chinner
2007-05-10 11:56                                     ` Amit K. Arora
2007-05-10 22:39                                       ` David Chinner
2007-05-11 11:03                                         ` Suparna Bhattacharya
2007-05-12  8:01                                           ` David Chinner
2007-06-12  6:16                                             ` Amit K. Arora
2007-06-12  8:11                                               ` David Chinner
2007-06-13 23:52                                               ` David Chinner
2007-06-14  9:14                                                 ` Andreas Dilger
2007-06-14 12:04                                                   ` David Chinner
2007-06-14 19:33                                                     ` Andreas Dilger
2007-06-25 13:28                                                       ` [PATCH 0/6][TAKE5] fallocate system call Amit K. Arora
2007-06-25 13:40                                                         ` [PATCH 1/7][TAKE5] fallocate() implementation on i386, x86_64 and powerpc Amit K. Arora
2007-06-26 19:38                                                           ` Heiko Carstens
2007-06-25 13:42                                                         ` [PATCH 2/7][TAKE5] fallocate() on s390(x) Amit K. Arora
2007-06-26 15:15                                                           ` Heiko Carstens
2007-06-25 13:43                                                         ` [PATCH 3/7][TAKE5] fallocate() on ia64 Amit K. Arora
2007-06-25 13:45                                                         ` [PATCH 4/7][TAKE5] support new modes in fallocate Amit K. Arora
2007-06-25 15:03                                                           ` Amit K. Arora
2007-06-25 21:46                                                             ` Andreas Dilger
2007-06-26 10:32                                                               ` Amit K. Arora
2007-06-26 15:34                                                                 ` Andreas Dilger
2007-06-26 19:09                                                                   ` Amit K. Arora
2007-06-26 23:18                                                                   ` David Chinner
2007-06-28 18:19                                                                     ` Amit K. Arora
2007-06-28 23:39                                                                       ` Nathan Scott
2007-06-29  1:03                                                                       ` David Chinner
2007-06-30 10:21                                                                 ` Christoph Hellwig
2007-06-30 16:52                                                                   ` Andreas Dilger
2007-07-03 10:08                                                                     ` Amit K. Arora
2007-07-03 10:31                                                                       ` Christoph Hellwig
2007-07-03 11:46                                                                         ` Amit K. Arora
2007-07-04  5:37                                                                           ` Timothy Shimmin
2007-07-11  9:04                                                                             ` Christoph Hellwig
2007-07-11  9:03                                                                           ` Christoph Hellwig
     [not found]                                                                             ` <20070712072813.GA31260@in.ibm.com>
2007-07-12  8:26                                                                               ` Amit K. Arora
2007-07-12 14:40                                                                                 ` Andreas Dilger
2007-07-12 13:13                                                                               ` David Chinner
2007-07-12 14:15                                                                                 ` Amit K. Arora
2007-07-01 22:55                                                                   ` David Chinner
2007-07-02 11:47                                                                     ` Amit K. Arora
2007-07-11  9:05                                                                     ` Christoph Hellwig
2007-06-26 23:14                                                               ` David Chinner
2007-06-27  3:49                                                                 ` Andreas Dilger
2007-06-27 13:36                                                                   ` David Chinner
2007-06-27 23:28                                                                     ` Nathan Scott
2007-06-28  0:39                                                                       ` David Chinner
2007-06-28  0:53                                                                         ` Nathan Scott
2007-06-30 10:26                                                                     ` Christoph Hellwig
2007-06-25 21:52                                                           ` Andreas Dilger
2007-06-26 10:45                                                             ` Amit K. Arora
2007-06-26 15:42                                                               ` Andreas Dilger
2007-06-26 19:12                                                                 ` Amit K. Arora
2007-06-26 23:32                                                                 ` David Chinner
2007-06-26 23:26                                                             ` David Chinner
2007-06-25 13:48                                                         ` [PATCH 5/7][TAKE5] ext4: fallocate support in ext4 Amit K. Arora
2007-06-25 13:49                                                         ` [PATCH 6/7][TAKE5] ext4: write support for preallocated blocks Amit K. Arora
2007-06-25 13:50                                                         ` [PATCH 7/7][TAKE5] ext4: support new modes Amit K. Arora
2007-06-25 21:56                                                           ` Andreas Dilger
2007-06-26 12:07                                                             ` Amit K. Arora
2007-06-26 16:14                                                               ` Andreas Dilger
2007-06-26 19:29                                                                 ` Amit K. Arora
2007-06-27  0:04                                                                   ` David Chinner
2007-06-28 18:07                                                                     ` Amit K. Arora
2007-06-26 23:15                                                         ` [PATCH 0/6][TAKE5] fallocate system call David Chinner
2007-06-28  9:55                                                         ` Andrew Morton
2007-06-28 17:36                                                           ` Mingming Cao
2007-06-28 17:57                                                           ` Amit K. Arora
2007-06-28 18:33                                                             ` Andrew Morton
2007-06-28 18:45                                                               ` Dave Kleikamp
2007-06-28 18:57                                                               ` Jeff Garzik
2007-06-29  7:20                                                               ` Christoph Hellwig
2007-06-29 13:56                                                               ` Theodore Tso
2007-06-29 14:29                                                                 ` Jeff Garzik
2007-06-29 17:42                                                                   ` Theodore Tso
2007-06-29 15:50                                                                 ` Mingming Caoc
2007-06-29 20:57                                                                   ` Andrew Morton
2007-06-28 20:34                                                             ` Andreas Dilger
2007-06-30 10:14                                                   ` [PATCH 1/5] fallocate() implementation in i86, x86_64 and powerpc Christoph Hellwig
2007-04-26 18:07                               ` [PATCH 2/5] fallocate() on s390 Amit K. Arora
2007-04-26 18:11                               ` [PATCH 3/5] ext4: Extent overlap bugfix Amit K. Arora
2007-05-04  4:30                                 ` Andrew Morton
2007-05-07 11:46                                   ` Amit K. Arora
2007-04-26 18:13                               ` [PATCH 4/5] ext4: fallocate support in ext4 Amit K. Arora
2007-05-04  4:31                                 ` Andrew Morton
2007-05-07 11:37                                   ` Andreas Dilger
2007-05-07 20:58                                     ` Andrew Morton
2007-05-07 22:21                                       ` Andreas Dilger
2007-05-07 22:38                                         ` Andrew Morton
2007-05-07 23:14                                           ` Theodore Tso
2007-05-07 23:31                                             ` Andrew Morton
2007-05-08  0:30                                               ` Mingming Cao
2007-05-07 23:02                                         ` Jeff Garzik
2007-05-07 23:36                                           ` Theodore Tso
2007-05-08  1:07                                           ` Andreas Dilger
2007-05-08  1:25                                             ` Jeff Garzik
2007-05-08  0:00                                       ` Mingming Cao
2007-05-08  0:15                                         ` Andrew Morton
2007-05-08  0:41                                           ` Mingming Cao
2007-05-08  1:43                                             ` Theodore Tso
2007-05-08 16:52                                               ` Andreas Dilger
2007-05-08 17:46                                               ` Mingming Cao
2007-05-14 13:34                                       ` Jan Kara
2007-05-07 12:07                                   ` Amit K. Arora
2007-05-07 15:24                                     ` Dave Kleikamp
2007-05-08 10:52                                       ` Amit K. Arora
2007-05-08 14:47                                         ` Dave Kleikamp
2007-04-26 18:16                               ` [PATCH 5/5] ext4: write support for preallocated blocks/extents Amit K. Arora
2007-05-04  4:32                                 ` Andrew Morton
2007-05-07 12:11                                   ` Amit K. Arora
2007-05-07 12:40                                 ` Pekka Enberg
2007-05-07 13:04                                   ` Amit K. Arora
2007-04-27 12:10                               ` [PATCH 0/5] fallocate system call Heiko Carstens
2007-04-27 14:43                                 ` Jörn Engel
2007-04-27 17:46                                   ` Heiko Carstens
2007-04-27 20:42                                     ` Chris Wedgwood
2007-04-30  0:47                               ` David Chinner
2007-04-30  3:09                                 ` [PATCH] ia64 fallocate syscall David Chinner
2007-04-30  3:11                                 ` [PATCH] XFS ->fallocate() support David Chinner
2007-04-30  3:14                                 ` [PATCH] Add preallocation beyond EOF to fallocate David Chinner
2007-04-30  5:25                                 ` [PATCH 0/5] fallocate system call Chris Wedgwood
2007-04-30  5:56                                   ` David Chinner
2007-04-30  6:01                                     ` Chris Wedgwood
2007-05-02 12:53                                   ` Amit K. Arora
2007-05-03 10:34                                     ` Andreas Dilger
2007-05-14 13:29                               ` [PATCH 0/5][TAKE2] " Amit K. Arora
     [not found]                                 ` <20070514142820.GA31468@amitarora.in.ibm.com>
2007-05-14 14:45                                   ` [PATCH 1/5][TAKE2] fallocate() implementation on i86, x86_64 and powerpc Amit K. Arora
2007-05-14 23:44                                     ` Stephen Rothwell
2007-05-15 13:23                                       ` Amit K. Arora
2007-05-14 14:48                                   ` [PATCH 2/5][TAKE2] fallocate() on s390 Amit K. Arora
2007-05-14 15:33                                     ` [PATCH 2/5][TAKE2] fallocate() on s390 - glibc wrapper Amit K. Arora
2007-05-14 14:50                                   ` [PATCH 3/5][TAKE2] ext4: Extent overlap bugfix Amit K. Arora
2007-05-14 14:52                                   ` [PATCH 4/5][TAKE2] ext4: fallocate support in ext4 Amit K. Arora
2007-05-14 14:54                                   ` [PATCH 5/5][TAKE2] ext4: write support for preallocated blocks Amit K. Arora
2007-05-15  6:31                                 ` [PATCH 0/5][TAKE2] fallocate system call Andreas Dilger
2007-05-15 12:40                                   ` Amit K. Arora
2007-05-15 19:37                               ` [PATCH 0/5][TAKE3] " Amit K. Arora
     [not found]                                 ` <20070515195421.GA2948@amitarora.in.ibm.com>
2007-05-15 20:03                                   ` [PATCH 1/5][TAKE3] fallocate() implementation on i86, x86_64 and powerpc Amit K. Arora
2007-05-16  0:42                                     ` Mingming Cao
2007-05-16 12:31                                       ` Amit K. Arora
2007-05-16  3:16                                     ` David Chinner
2007-05-16 12:21                                       ` Dave Kleikamp
2007-05-16 12:37                                         ` Amit K. Arora
2007-05-16 23:40                                         ` David Chinner
2007-05-17 12:10                                           ` Dave Kleikamp
2007-05-17 12:28                                           ` Amit K. Arora
2007-05-15 20:10                                   ` [PATCH 2/5][TAKE3] fallocate() on s390 Amit K. Arora
2007-05-15 20:13                                   ` [PATCH 3/5][TAKE3] ext4: Extent overlap bugfix Amit K. Arora
2007-05-15 20:16                                   ` [PATCH 4/5][TAKE3] ext4: fallocate support in ext4 Amit K. Arora
2007-05-15 20:18                                   ` [PATCH 5/5][TAKE3] ext4: write support for preallocated blocks Amit K. Arora
2007-05-15 23:52                                 ` [PATCH 0/5][TAKE3] fallocate system call Mingming Cao
2007-05-17 14:11                               ` [PATCH 0/6][TAKE4] " Amit K. Arora
     [not found]                                 ` <20070517141458.GA26641@amitarora.in.ibm.com>
2007-05-17 14:23                                   ` [PATCH 1/6][TAKE4] fallocate() implementation on i86, x86_64 and powerpc Amit K. Arora
2007-05-17 14:25                                   ` [PATCH 2/6][TAKE4] fallocate() on s390 Amit K. Arora
2007-05-17 14:25                                   ` [PATCH 3/6][TAKE4] fallocate() on ia64 Amit K. Arora
2007-05-17 14:26                                   ` [PATCH 4/6][TAKE4] ext4: Extent overlap bugfix Amit K. Arora
2007-05-17 14:29                                   ` [PATCH 5/6][TAKE4] ext4: fallocate support in ext4 Amit K. Arora
2007-05-17 14:30                                   ` [PATCH 6/6][TAKE4] ext4: write support for preallocated blocks Amit K. Arora
2007-05-19  6:44                                 ` [PATCH 0/6][TAKE4] fallocate system call Andrew Morton
2007-05-21  5:24                                   ` Mingming Cao
2007-03-30  7:19                 ` Interface for the new fallocate() " Heiko Carstens
2007-03-30  9:15                   ` Paul Mackerras
2007-03-30 10:44                     ` Jörn Engel
2007-03-30 12:55                       ` Heiko Carstens
2007-04-09 13:01                       ` Paul Mackerras
2007-04-09 16:34                         ` Jörn Engel
2007-03-17  5:33       ` [RFC][PATCH] sys_fallocate() " Stephen Rothwell
2007-03-19  9:30         ` Amit K. Arora
2007-03-17 14:53       ` Russell King

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=20070504072742.GK32602149@melbourne.sgi.com \
    --to=dgc@sgi.com \
    --cc=aarora@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=cmm@us.ibm.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=suparna@in.ibm.com \
    --cc=torvalds@linux-foundation.org \
    --cc=xfs@oss.sgi.com \
    /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