summaryrefslogtreecommitdiff
path: root/ufs
diff options
context:
space:
mode:
Diffstat (limited to 'ufs')
-rw-r--r--ufs/ChangeLog6
-rw-r--r--ufs/inode.c4
2 files changed, 9 insertions, 1 deletions
diff --git a/ufs/ChangeLog b/ufs/ChangeLog
index d8e04a0e..8f651624 100644
--- a/ufs/ChangeLog
+++ b/ufs/ChangeLog
@@ -1,3 +1,9 @@
+2001-06-09 Mark Kettenis <kettenis@gnu.org>
+
+ * inode.c (diskfs_set_statfs): If number of free blocks is less
+ than the number of reserved blocks, set the number of available
+ blocks to 0.
+
2001-01-08 Marcus Brinkmann <marcus@gnu.org>
* main.c (main): Use %Ld instead %ld to print store->size.
diff --git a/ufs/inode.c b/ufs/inode.c
index 72467e1a..2647754c 100644
--- a/ufs/inode.c
+++ b/ufs/inode.c
@@ -1,5 +1,5 @@
/* Inode management routines
- Copyright (C) 1994,95,96,97,98,2000 Free Software Foundation, Inc.
+ Copyright (C) 1994,95,96,97,98,2000,01 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@ -519,6 +519,8 @@ diskfs_set_statfs (struct statfs *st)
+ sblock->fs_cstotal.cs_nffree);
st->f_bavail = ((sblock->fs_dsize * (100 - sblock->fs_minfree) / 100)
- (sblock->fs_dsize - st->f_bfree));
+ if (st->f_bfree < ((sblock->fs_dsize * (100 - sblock->fs_minfree) / 100)))
+ st->f_bavail = 0;
st->f_files = sblock->fs_ncg * sblock->fs_ipg - 2; /* not 0 or 1 */
st->f_ffree = sblock->fs_cstotal.cs_nifree;
st->f_fsid = getpid ();