public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ulrich Drepper <drepper@redhat.com>
To: Linux Kernel <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: fallocate syscall interface defficiency
Date: Mon, 23 Jul 2007 10:22:57 -0700	[thread overview]
Message-ID: <46A4E3F1.7050602@redhat.com> (raw)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The fallocate syscall returns ENOSYS in case the filesystem does not
support the operation and expects the userlevel code to fill in.  This
is good in concept.

The problem is that the libc code for old kernels should be able to
distinguish the case where the syscall is not at all available vs not
functioning for a specific mount point.  As is this is not possible and
we always have to invoke the syscall even if the kernel doesn't support it.

I suggest the following patch (and yes, Al, you need a mailer which
automatically removes "- " before leading dashes).  Using EOPNOTSUPP is
IMO the right thing to do.

- --- fs/open.c	2007-07-18 20:25:41.000000000 -0700
+++ fs/open.c-new	2007-07-23 10:17:17.000000000 -0700
@@ -403,7 +403,7 @@
 	if (inode->i_op && inode->i_op->fallocate)
 		ret = inode->i_op->fallocate(inode, mode, offset, len);
 	else
- -		ret = -ENOSYS;
+		ret = -EOPNOTSUPP;

 out_fput:
 	fput(file);


- --
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQFGpOPx2ijCOnn/RHQRAl4aAKC0TtQ65aBGhORbnniQg9lJwoWiQgCfT2B7
BGgDLLcTgGsd1I9HMRo/+z4=
=G5y6
-----END PGP SIGNATURE-----

                 reply	other threads:[~2007-07-23 17:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=46A4E3F1.7050602@redhat.com \
    --to=drepper@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@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