* Fix bug in fuse_readpages() causing Oops in certain situations.
Bug found by Vincenzo Ciancia.
+ * Fix compilation with kernels versions > 2.6.9.
+
2004-11-11 Miklos Szeredi <miklos@szeredi.hu>
* Check kernel interface version in fusermount to prevent
(!(fc->flags & FUSE_ALLOW_ROOT) || current->fsuid != 0))
return -EACCES;
else if (fc->flags & FUSE_DEFAULT_PERMISSIONS) {
- int err = vfs_permission(inode, mask);
+ int err;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
+ err = vfs_permission(inode, mask);
+#else
+ err = generic_permission(inode, mask, NULL);
+#endif
/* If permission is denied, try to refresh file
attributes. This is also needed, because the root
if (err == -EACCES) {
err = fuse_do_getattr(inode);
- if (!err)
+ if (!err) {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
err = vfs_permission(inode, mask);
+#else
+ err = generic_permission(inode, mask, NULL);
+#endif
+ }
}
/* FIXME: Need some mechanism to revoke permissions:
if (attr->ia_valid & ATTR_SIZE) {
unsigned long limit;
is_truncate = 1;
-
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
limit = current->rlim[RLIMIT_FSIZE].rlim_cur;
- if (limit != RLIM_INFINITY && attr->ia_size > limit) {
+#else
+ limit = current->signal->rlim[RLIMIT_FSIZE].rlim_cur;
+#endif
+ if (limit != RLIM_INFINITY && attr->ia_size > (loff_t) limit) {
send_sig(SIGXFSZ, current, 0);
return -EFBIG;
}