fallocate syscall interface defficiency

From: Ulrich Drepper
Date: Mon Jul 23 2007 - 13:23:52 EST


-----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-----
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/