From: Russ Allbery Date: Sun, 18 Mar 2007 02:03:08 +0000 (+0000) Subject: * Apply upstream fix to show reasonable free space numbers for AFS in X-Git-Tag: debian/1.4.2-6~1 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=e60e4c38dea9be534a3e69d5bbf6ba9cb08682d8;p=packages%2Fo%2Fopenafs.git * Apply upstream fix to show reasonable free space numbers for AFS in df. Without this fix, some programs which use df to check free space may think that directories in AFS are full and prevent the user from attempting to write files. (Closes: #415294) --- diff --git a/acinclude.m4 b/acinclude.m4 index fb8001a53..2d241e086 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -613,6 +613,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGNAL_RLIM LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_EXIT_STATE LINUX_GET_SB_HAS_STRUCT_VFSMOUNT + LINUX_STATFS_TAKES_DENTRY LINUX_REFRIGERATOR LINUX_LINUX_KEYRING_SUPPORT LINUX_KEY_ALLOC_NEEDS_STRUCT_TASK @@ -784,6 +785,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) if test "x$ac_cv_linux_get_sb_has_struct_vfsmount" = "xyes"; then AC_DEFINE(GET_SB_HAS_STRUCT_VFSMOUNT, 1, [define if your get_sb_nodev needs a struct vfsmount argument]) fi + if test "x$ac_cv_linux_statfs_takes_dentry" = "xyes"; then + AC_DEFINE(STATFS_TAKES_DENTRY, 1, [define if your statfs takes a dentry argument]) + fi if test "x$ac_cv_linux_func_a_writepage_takes_writeback_control" = "xyes" ; then AC_DEFINE(AOP_WRITEPAGE_TAKES_WRITEBACK_CONTROL, 1, [define if your aops.writepage takes a struct writeback_control argument]) fi diff --git a/debian/changelog b/debian/changelog index 4e43bd0b9..7fdbea16c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,10 @@ openafs (1.4.2-6) unstable; urgency=medium ordering problems that could lead the kernel to ignore some group membership for users. (Closes: #414911) * Apply upstream fix for segfaults in pts rename. (Closes: #409184) + * Apply upstream fix to show reasonable free space numbers for AFS in + df. Without this fix, some programs which use df to check free space + may think that directories in AFS are full and prevent the user from + attempting to write files. (Closes: #415294) * Translation updates: - Dutch, thanks cobaco. (Closes: #413701) - Portuguese, thanks Miguel Figueiredo. (Closes: #414800) diff --git a/debian/control b/debian/control index 09d48a4fb..b263e03c1 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: net Priority: optional Maintainer: Sam Hartman Uploaders: Russ Allbery -Build-Depends: debhelper (>= 5), libncurses5-dev, libpam0g-dev, bison, docbook-to-man, flex, perl, comerr-dev, libkrb5-dev +Build-Depends: debhelper (>= 5), libncurses5-dev, libpam0g-dev, bison, docbook-to-man, flex, perl, comerr-dev, libkrb5-dev, autoconf Standards-Version: 3.7.2 Package: openafs-client diff --git a/debian/rules b/debian/rules index 2d82925ec..7f2583c9d 100755 --- a/debian/rules +++ b/debian/rules @@ -86,6 +86,7 @@ configure: configure-stamp configure-stamp: @if test x"$(SYS_NAME)" = x"UNKNOWN" ; then exit 1 ; fi dh_testdir + sh regen.sh afslogsdir=/var/log/openafs afslocaldir=/etc/openafs/server-local \ sh configure \ --with-afs-sysname=$(SYS_NAME) --disable-kernel-module \ @@ -104,7 +105,6 @@ build-indep: build-stamp: dh_testdir mkdir -p $(CURDIR)/debian/tmp - cd doc/man-pages && perl generate-man $(MAKE) install_nolibafs DESTDIR=$(CURDIR)/debian/tmp chmod +x debian/afs-rootvol debian/afs-newcell touch build-stamp diff --git a/src/afs/LINUX/osi_vfsops.c b/src/afs/LINUX/osi_vfsops.c index 54bca905f..bf41d878e 100644 --- a/src/afs/LINUX/osi_vfsops.c +++ b/src/afs/LINUX/osi_vfsops.c @@ -64,11 +64,12 @@ int afs_fill_super(struct super_block *sb, void *data, int silent); * dev, covered, s_rd_only, s_dirt, and s_type will be set by read_super. */ #if defined(AFS_LINUX26_ENV) -static struct super_block * #ifdef GET_SB_HAS_STRUCT_VFSMOUNT +int afs_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name, void *data, struct vfsmount *mnt) #else +static struct superblock * afs_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name, void *data) #endif @@ -385,7 +386,11 @@ afs_put_super(struct super_block *sbp) */ #if defined(AFS_LINUX26_ENV) int +#if defined(STATFS_TAKES_DENTRY) +afs_statfs(struct dentry *dentry, struct kstatfs *statp) +#else afs_statfs(struct super_block *sbp, struct kstatfs *statp) +#endif #elif defined(AFS_LINUX24_ENV) int afs_statfs(struct super_block *sbp, struct statfs *statp) @@ -409,7 +414,11 @@ afs_statfs(struct super_block *sbp, struct statfs *__statp, int size) AFS_STATCNT(afs_statfs); statp->f_type = 0; /* Can we get a real type sometime? */ +#if defined(STATFS_TAKES_DENTRY) + statp->f_bsize = dentry->d_sb->s_blocksize; +#else statp->f_bsize = sbp->s_blocksize; +#endif statp->f_blocks = statp->f_bfree = statp->f_bavail = statp->f_files = statp->f_ffree = 9000000; statp->f_fsid.val[0] = AFS_VFSMAGIC; diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 index 2c2942336..22cbee6f1 100644 --- a/src/cf/linux-test4.m4 +++ b/src/cf/linux-test4.m4 @@ -608,6 +608,19 @@ AC_DEFUN([LINUX_GET_SB_HAS_STRUCT_VFSMOUNT], [ ac_cv_linux_get_sb_has_struct_vfsmount=no)]) AC_MSG_RESULT($ac_cv_linux_get_sb_has_struct_vfsmount)]) +AC_DEFUN([LINUX_STATFS_TAKES_DENTRY], [ + AC_MSG_CHECKING([for dentry in statfs]) + AC_CACHE_VAL([ac_cv_linux_statfs_takes_dentry], [ + AC_TRY_KBUILD( +[#include +#include ], +[ +extern int vfs_statfs(struct dentry *, struct kstatfs *); +], + ac_cv_linux_statfs_takes_dentry=yes, + ac_cv_linux_statfs_takes_dentry=no)]) + AC_MSG_RESULT($ac_cv_linux_statfs_takes_dentry)]) + AC_DEFUN([LINUX_LINUX_KEYRING_SUPPORT], [ AC_MSG_CHECKING([for linux kernel keyring support]) AC_CACHE_VAL([ac_cv_linux_keyring_support], [