Index: openafs-1.6.9/acinclude.m4
===================================================================
--- openafs-1.6.9.orig/acinclude.m4
+++ openafs-1.6.9/acinclude.m4
@@ -901,6 +901,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinu
 		 AC_CHECK_LINUX_FUNC([do_sync_read],
 				     [#include <linux/fs.h>],
 				     [do_sync_read(NULL, NULL, 0, NULL);])
+		 AC_CHECK_LINUX_FUNC([file_dentry],
+				     [#include <linux/fs.h>],
+				     [struct file *f; file_dentry(f);])
 		 AC_CHECK_LINUX_FUNC([find_task_by_pid],
 				     [#include <linux/sched.h>],
 				     [pid_t p; find_task_by_pid(p);])
@@ -947,6 +950,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinu
 		 AC_CHECK_LINUX_FUNC([set_nlink],
 				     [#include <linux/fs.h>],
 				     [set_nlink(NULL, 1);])
+		 AC_CHECK_LINUX_FUNC([setattr_prepare],
+				     [#include <linux/fs.h>],
+				     [setattr_prepare(NULL, NULL);])
 		 AC_CHECK_LINUX_FUNC([sock_create_kern],
 				     [#include <linux/net.h>],
 				     [sock_create_kern(0, 0, 0, NULL);])
Index: openafs-1.6.9/src/afs/LINUX/osi_file.c
===================================================================
--- openafs-1.6.9.orig/src/afs/LINUX/osi_file.c
+++ openafs-1.6.9/src/afs/LINUX/osi_file.c
@@ -184,7 +184,11 @@ osi_UFSTruncate(struct osi_file *afile,
     newattrs.ia_ctime = CURRENT_TIME;
 
     /* avoid notify_change() since it wants to update dentry->d_parent */
+#ifdef HAVE_LINUX_SETATTR_PREPARE
+    code = setattr_prepare(file_dentry(afile->filp), &newattrs);
+#else
     code = inode_change_ok(inode, &newattrs);
+#endif
     if (!code)
 	code = afs_inode_setattr(afile, &newattrs);
     if (!code)
Index: openafs-1.6.9/src/afs/LINUX/osi_compat.h
===================================================================
--- openafs-1.6.9.orig/src/afs/LINUX/osi_compat.h
+++ openafs-1.6.9/src/afs/LINUX/osi_compat.h
@@ -41,6 +41,10 @@ typedef struct path afs_linux_path_t;
 # define d_alias d_u.d_alias
 #endif
 
+#ifndef HAVE_LINUX_FILE_DENTRY
+#define file_dentry(file) ((file)->f_dentry)
+#endif
+
 #ifndef HAVE_LINUX_DO_SYNC_READ
 static inline int
 do_sync_read(struct file *fp, char *buf, size_t count, loff_t *offp) {
