diff options
-rw-r--r-- | ext2fs/ChangeLog | 6 | ||||
-rw-r--r-- | ext2fs/inode.c | 4 | ||||
-rw-r--r-- | ufs/ChangeLog | 6 | ||||
-rw-r--r-- | ufs/inode.c | 4 |
4 files changed, 18 insertions, 2 deletions
diff --git a/ext2fs/ChangeLog b/ext2fs/ChangeLog index 2c83b45d..bce6edfa 100644 --- a/ext2fs/ChangeLog +++ b/ext2fs/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-03-03 Roland McGrath <roland@frob.com> * hyper.c (zeroblock, modified_global_blocks): Remove superfluous diff --git a/ext2fs/inode.c b/ext2fs/inode.c index 71b00705..0485b71e 100644 --- a/ext2fs/inode.c +++ b/ext2fs/inode.c @@ -1,6 +1,6 @@ /* Inode management routines - Copyright (C) 1994,95,96,97,98,99,2000 Free Software Foundation, Inc. + Copyright (C) 1994,95,96,97,98,99,2000,01 Free Software Foundation, Inc. Converted for ext2fs by Miles Bader <miles@gnu.org> @@ -618,6 +618,8 @@ diskfs_set_statfs (struct statfs *st) st->f_blocks = sblock->s_blocks_count; st->f_bfree = sblock->s_free_blocks_count; st->f_bavail = st->f_bfree - sblock->s_r_blocks_count; + if (st->f_bfree < sblock->s_r_blocks_count) + st->f_bavail = 0; st->f_files = sblock->s_inodes_count; st->f_ffree = sblock->s_free_inodes_count; st->f_fsid = getpid (); 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 (); |