diff --git a/acinclude.m4 b/acinclude.m4 index f8c8456dae..c46a12073a 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1082,6 +1082,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) AC_CHECK_LINUX_FUNC([set_nlink], [#include ], [set_nlink(NULL, 1);]) + AC_CHECK_LINUX_FUNC([setattr_prepare], + [#include ], + [setattr_prepare(NULL, NULL);]) AC_CHECK_LINUX_FUNC([sock_create_kern], [#include ], [sock_create_kern(0, 0, 0, NULL);]) diff --git a/src/afs/LINUX/osi_file.c b/src/afs/LINUX/osi_file.c index c125c1ca7b..e211c055fa 100644 --- a/src/afs/LINUX/osi_file.c +++ b/src/afs/LINUX/osi_file.c @@ -183,7 +183,11 @@ osi_UFSTruncate(struct osi_file *afile, afs_int32 asize) 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)