--- a/inode.c.orig +++ b/inode.c @@ -1811,14 +1811,13 @@ */ if (mask & MAY_ACCESS) { /* For sys_access. */ struct dentry *dentry; - struct hlist_node *p; int dcount = 0; if (mask & MAY_NOT_BLOCK) return -ECHILD; /* Find a dentry with valid d_count. Refer bug 587879. */ - hlist_for_each_entry(dentry, p, &inode->i_dentry, d_alias) { + hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) { dcount = dentry->d_count; if (dcount) { LOG(4, ("Found %s %d \n", dentry->d_name.name, dcount)); --- a/shared/compat_mm.h.orig +++ b/shared/compat_mm.h @@ -90,9 +90,9 @@ #endif /* - * In 2.4.10, vmtruncate was changed from returning void to returning int. + * In 3.8.0, vmtruncate was changed from returning void to returning int. */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 10) +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0) #define compat_vmtruncate(inode, size) \ ({ \ int result = 0; \ @@ -100,5 +100,12 @@ result; \ }) #else -#define compat_vmtruncate(inode, size) vmtruncate(inode, size) +#define compat_vmtruncate(inode, size) \ +({ \ + int result = inode_newsize_ok(inode, size); \ + if (!result) { \ + truncate_setsize(inode, size); \ + } \ + result; \ +}) #endif