stress2: Fix a bug introduced in 3647609110201ad09b8c7b945941765be8924123.
authorSascha Wildner <saw@online.de>
Mon, 14 Nov 2011 02:11:56 +0000 (03:11 +0100)
committerSascha Wildner <saw@online.de>
Mon, 14 Nov 2011 02:11:56 +0000 (03:11 +0100)
Even though we use statvfs() for a couple of things now, we still need
to statfs() too for getting at f_mntfromname[].

test/stress/stress2/lib/resources.c

index 7b6e381..564d8f8 100644 (file)
@@ -65,10 +65,12 @@ inodes(void)
        if (getcwd(path, sizeof(path)) == NULL)
                err(1, "getcwd()");
 
-       if (statvfs(path, &buf) < 0)
+       if (statfs(path, &sbuf) < 0)
                err(1, "statfs(%s)", path);
+       if (statvfs(path, &buf) < 0)
+               err(1, "statvfs(%s)", path);
        if (!strcmp(sbuf.f_fstypename, "msdosfs"))
-                       buf.f_ffree = 9999;
+               buf.f_ffree = 9999;
        flags = sbuf.f_flags & MNT_VISFLAGMASK;
        if (op->verbose > 2)
                printf("Free inodes on %s (%s): %jd\n", path, sbuf.f_mntonname,