From: Ted Ts'o <tytso@mit.edu>
To: Andreas Dilger <adilger@whamcloud.com>
Cc: Ext4 Developers List <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH -v2] ext4: add max_dir_size_kb mount option
Date: Sat, 11 Aug 2012 17:13:13 -0400 [thread overview]
Message-ID: <20120811211313.GA906@thunk.org> (raw)
In-Reply-To: <20120811192648.GA9363@thunk.org>
On Sat, Aug 11, 2012 at 03:26:48PM -0400, Theodore Ts'o wrote:
> On Fri, Aug 10, 2012 at 09:22:39PM -0600, Andreas Dilger wrote:
> >
> > In our patch, it returns EFBIG, since it isn't really a case of
> > being out of space for blocks or inodes.
>
> I agree, EFBIG seems to be a better errno.
Hmmm..... upon doing some more research, there was a related
discussion on this point on the IETF NFSv4 mailing list earlier this
year[1]. In it, Trond argued that EFBIG is defined by POSIX to mean:
"An attempt was made to write a file that exceeds the file size limit
of the process.", while ENOSPC is explicitly documented as an
allowable error code for rename(2):
[ENOSPC]
The directory that would contain new cannot be extended.
The same definition is there for link(2) and open(2). For open, it
reads:
[ENOSPC]
The directory or file system that would contain the new file
cannot be expanded, the file does not exist, and O_CREAT is
specified.
Hence, Trond argued that using ENOSPC was a better choice, in terms of
being a closer match with POSIX specifications, and hence what
programs might expect.
The string returned by perror/strerror is going to be a little
confusing to users in either case. EFBIG returns "File too large",
while ENOSPC returns "No space left on device". One might argue that
ENOSPC's error return is a little better, but then again there's a
grand Unix tradition in this, after all --- "Not a typewriter",
anyone? :-)
- Ted
[1] http://www.ietf.org/mail-archive/web/nfsv4/current/msg10720.html
P.S. The context for this is a feature which the NetApp filer has,
MaxDirSize, which controls the maximum size of a directory specified
in Kilobytes. The discussion was what was the proper NFS error code
that should be returned, given how it would be reflected back to a
Posix errno by most clients.
Interestingly, it appears the default MaxDirSize starting with
NetApp's Data before ONTAP 6.5 was 64k. On newer NetApps, the limit
is defaulted to be 1% of the memory size configured on the filer. The
reason given for limiting the maximum directory size was for
performance reasons. Given the issues we've seen when you have jobs
running with a 512mb memory cgroup (which would also apply if you were
running a micro EC2 instance, or some other Xen or KVM VM with a small
memory size), it's interesting that this was an issue that NetApp has
run into, and addressed the same way.
I can definitely attest to the fact that the system will not be happy
if you are limited to 512mb of memory, and you have a 176mb
directory....
prev parent reply other threads:[~2012-08-11 21:13 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-10 19:23 [PATCH] ext4: add max_dir_size_kb mount option Theodore Ts'o
2012-08-10 19:38 ` Eric Sandeen
2012-08-10 19:59 ` Theodore Ts'o
2012-08-10 20:16 ` Eric Sandeen
2012-08-10 21:59 ` Theodore Ts'o
2012-08-10 20:11 ` Jeff Moyer
2012-08-10 21:58 ` Theodore Ts'o
2012-08-10 23:14 ` Andreas Dilger
2012-08-11 1:40 ` [PATCH -v2] " Theodore Ts'o
2012-08-11 3:22 ` Andreas Dilger
2012-08-11 19:26 ` Theodore Ts'o
2012-08-11 21:10 ` Andreas Dilger
2012-08-11 21:13 ` Ted Ts'o [this message]
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=20120811211313.GA906@thunk.org \
--to=tytso@mit.edu \
--cc=adilger@whamcloud.com \
--cc=linux-ext4@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).