We report 'fake' values for free space, free file nodes, etc for the
'AFS' filesystem, since these values are not meaningful for AFS
itself. Currently we report about 9G of free space for most platforms,
and a few different values for a few others. Raise all of these to
2^32-1, so that trying to copy over 9G of data into AFS does not fail
for those applications that check the destination free space with
statfs(2). Note that one such application is KDE 4.8.x.
Consolidate all places that do this, and put the 'fake' value in one
place, AFS_VFS_FAKEFREE, along with the relevant comments.
Related issues reported by Lars Schimmer, Richard Brittain, and
others.
Reviewed-on: http://gerrit.openafs.org/9688
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Markus Koeberl <markus.koeberl@tugraz.at>
Tested-by: Markus Koeberl <markus.koeberl@tugraz.at>
Reviewed-by: D Brashear <shadow@your-file-system.com>
(cherry picked from commit
e385571ba37fa6d43fecca17e9e5d60a22a414cd)
Change-Id: Id9b5fa92f48bc83b84bb4f50bc0ae25b028694b0
Reviewed-on: http://gerrit.openafs.org/10984
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
abp->f_type = 0;
abp->f_bsize = afsp->vfs_bsize;
abp->f_blocks = abp->f_bfree = abp->f_bavail = abp->f_files =
- abp->f_ffree = 9000000;
+ abp->f_ffree = AFS_VFS_FAKEFREE;
abp->f_vfstype = AFS_VFSFSID;
abp->f_vfsnumber = afsp->vfs_number;
abp->f_vfsoff = abp->f_vfslen = abp->f_vfsvers = -1;
abp->f_type = MOUNT_AFS;
#endif
- /* Fake a high number below to satisfy programs that use the statfs call
- * to make sure that there's enough space in the device partition before
- * storing something there.
- */
abp->f_blocks = abp->f_bfree = abp->f_bavail = abp->f_files =
- abp->f_ffree = 0x7fffffff;
+ abp->f_ffree = AFS_VFS_FAKEFREE;
if (abp != sysstat) {
abp->f_fsid.val[0] = sysstat->f_fsid.val[0];
abp->f_bsize = mp->vfs_bsize;
abp->f_iosize = mp->vfs_bsize;
- /* Fake a high number below to satisfy programs that use the statfs call
- * to make sure that there's enough space in the device partition before
- * storing something there.
- */
abp->f_blocks = abp->f_bfree = abp->f_bavail = abp->f_files =
- abp->f_ffree = 2000000;
+ abp->f_ffree = AFS_VFS_FAKEFREE;
abp->f_fsid.val[0] = mp->mnt_stat.f_fsid.val[0];
abp->f_fsid.val[1] = mp->mnt_stat.f_fsid.val[1];
* before storing something there.
*/
abp->f_blocks = abp->f_bfree = abp->f_bavail = abp->f_files =
- abp->f_ffree = abp->f_favail = 9000000;
+ abp->f_ffree = abp->f_favail = AFS_VFS_FAKEFREE;
abp->f_fsid = (AFS_VFSMAGIC << 16) || AFS_VFSFSID;
AFS_GUNLOCK();
* before storing something there.
*/
abp->f_blocks = abp->f_bfree = abp->f_bavail = abp->f_files =
- abp->f_ffree = abp->f_favail = 900000;
+ abp->f_ffree = abp->f_favail = AFS_VFS_FAKEFREE;
abp->f_fsid = AFS_VFSMAGIC; /* magic */
strcpy(abp->f_basetype, AFS_MOUNT_AFS);
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_ffree = AFS_VFS_FAKEFREE;
statp->f_fsid.val[0] = AFS_VFSMAGIC;
statp->f_fsid.val[1] = AFS_VFSFSID;
statp->f_namelen = 256;
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_ffree = AFS_VFS_FAKEFREE;
statp->f_fsid.val[0] = AFS_VFSMAGIC;
statp->f_fsid.val[1] = AFS_VFSFSID;
statp->f_namelen = 256;
abp->f_frsize = mp->osi_vfs_bsize;
abp->f_iosize = mp->osi_vfs_bsize;
- /*
- * Fake a high number below to satisfy programs that use the ustat (for
- * * AIX), or statfs (for the rest) call to make sure that there's
- * enough * space in the device partition before storing something there
- * (like * ed(1))
- */
abp->f_blocks = abp->f_bfree = abp->f_bavail = abp->f_files =
- abp->f_ffree = 9000000;
+ abp->f_ffree = AFS_VFS_FAKEFREE;
return (0);
}
AFS_STATCNT(afs_statfs);
abp->f_bsize = afsp->osi_vfs_bsize;
- /*
- * Fake a high number below to satisfy programs that use the ustat (for
- * * AIX), or statfs (for the rest) call to make sure that there's
- * enough * space in the device partition before storing something there
- * (like * ed(1))
- */
abp->f_blocks = abp->f_bfree = abp->f_bavail = abp->f_files =
- abp->f_ffree = 9000000;
+ abp->f_ffree = AFS_VFS_FAKEFREE;
abp->f_fsid.val[0] = AFS_VFSMAGIC; /* magic */
abp->f_fsid.val[1] = (int)AFS_VFSFSID;
return 0;
AFS_STATCNT(afs_statfs);
abp->f_frsize = 1024;
- abp->f_favail = 9000000;
abp->f_bsize = afsp->vfs_bsize;
abp->f_blocks = abp->f_bfree = abp->f_bavail = abp->f_files =
- abp->f_ffree = 9000000;
+ abp->f_favail = abp->f_ffree = AFS_VFS_FAKEFREE;
abp->f_fsid = (AFS_VFSMAGIC << 16) || AFS_VFSFSID;
AFS_GUNLOCK();
AFS_STATCNT(afs_statfs);
abp->f_frsize = 1024;
- abp->f_favail = 9000000;
abp->f_bsize = afsp->vfs_bsize;
abp->f_blocks = abp->f_bfree = abp->f_bavail = abp->f_files =
- abp->f_ffree = 9000000;
+ abp->f_favail = abp->f_ffree = AFS_VFS_FAKEFREE;
#ifdef AFS_USR_AIX_ENV
abp->f_fsid.val[0] = AFS_VFSMAGIC;
#define AFS_VFSFSID AFS_MOUNT_AFS
#endif
#endif
+/* use this value for reporting total space, free space, etc.
+ * fake a high number to satisfy programs that use the statfs call to make sure
+ * that there's enough space in the device partition before storing something
+ * there. keep it just under 2^31, to try and be safe about not breaking
+ * stuff that looks at the amount of free space. */
+#define AFS_VFS_FAKEFREE (2147483647)
/* Moved from VNOPS/afs_vnop_flocks so can be used in prototypes */
#if defined(AFS_HPUX102_ENV)