* fallocate syscall interface defficiency
@ 2007-07-23 17:22 Ulrich Drepper
0 siblings, 0 replies; only message in thread
From: Ulrich Drepper @ 2007-07-23 17:22 UTC (permalink / raw)
To: Linux Kernel, Andrew Morton
-----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-----
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-07-23 17:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-23 17:22 fallocate syscall interface defficiency Ulrich Drepper
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox