summaryrefslogtreecommitdiffstats
path: root/sbin/fsck_ffs/pass5.c
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2005-03-07 08:42:49 +0000
committerdelphij <delphij@FreeBSD.org>2005-03-07 08:42:49 +0000
commit50d65e6e8dfe7acfb233acf00aae3c86ad106694 (patch)
tree4a55cc21d650dd93da6eb7cdf52fd17aa3778ba7 /sbin/fsck_ffs/pass5.c
parentd3c3434c1cc5d8a3a7efde19b203447a56837ea0 (diff)
downloadFreeBSD-src-50d65e6e8dfe7acfb233acf00aae3c86ad106694.zip
FreeBSD-src-50d65e6e8dfe7acfb233acf00aae3c86ad106694.tar.gz
Make background fsck based summary adjustments actually work by
initializing the sysctl mibs data before actually using them. The original patchset (which is the actual version that is running on my testboxes) have checked whether all of these sysctls and refuses to do background fsck if we don't have them. Kirk has pointed out that refusing running fsck on old kernels is pointless, as old kernels will recompute the summary at mount time, so I have removed these checks. Unfortunatelly, as the checks will initialize the mib values of those sysctl's, and which are vital for the runtime summary adjustment to work, we can not simply remove the check, which will lead to problem when running background fsck over a dirty volume. Add these checks in a different way: give a warning rather than refusing to work, and complain if the functionality is not available when adjustments are necessary. Noticed by: A power failure at my lab Pointy hat: me MFC After: 3 days
Diffstat (limited to 'sbin/fsck_ffs/pass5.c')
-rw-r--r--sbin/fsck_ffs/pass5.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sbin/fsck_ffs/pass5.c b/sbin/fsck_ffs/pass5.c
index 796b546..693831f 100644
--- a/sbin/fsck_ffs/pass5.c
+++ b/sbin/fsck_ffs/pass5.c
@@ -358,7 +358,7 @@ pass5(void)
if (cmd.value != 0) {
if (debug)
printf("adjndir by %+" PRIi64 "\n", cmd.value);
- if (sysctl(adjndir, MIBSIZE, 0, 0,
+ if (bkgrdsumadj == 0 || sysctl(adjndir, MIBSIZE, 0, 0,
&cmd, sizeof cmd) == -1)
rwerror("ADJUST NUMBER OF DIRECTORIES", cmd.value);
}
@@ -367,7 +367,7 @@ pass5(void)
if (cmd.value != 0) {
if (debug)
printf("adjnbfree by %+" PRIi64 "\n", cmd.value);
- if (sysctl(adjnbfree, MIBSIZE, 0, 0,
+ if (bkgrdsumadj == 0 || sysctl(adjnbfree, MIBSIZE, 0, 0,
&cmd, sizeof cmd) == -1)
rwerror("ADJUST NUMBER OF FREE BLOCKS", cmd.value);
}
@@ -376,7 +376,7 @@ pass5(void)
if (cmd.value != 0) {
if (debug)
printf("adjnifree by %+" PRIi64 "\n", cmd.value);
- if (sysctl(adjnifree, MIBSIZE, 0, 0,
+ if (bkgrdsumadj == 0 || sysctl(adjnifree, MIBSIZE, 0, 0,
&cmd, sizeof cmd) == -1)
rwerror("ADJUST NUMBER OF FREE INODES", cmd.value);
}
@@ -385,7 +385,7 @@ pass5(void)
if (cmd.value != 0) {
if (debug)
printf("adjnffree by %+" PRIi64 "\n", cmd.value);
- if (sysctl(adjnffree, MIBSIZE, 0, 0,
+ if (bkgrdsumadj == 0 || sysctl(adjnffree, MIBSIZE, 0, 0,
&cmd, sizeof cmd) == -1)
rwerror("ADJUST NUMBER OF FREE FRAGS", cmd.value);
}
@@ -394,7 +394,7 @@ pass5(void)
if (cmd.value != 0) {
if (debug)
printf("adjnumclusters by %+" PRIi64 "\n", cmd.value);
- if (sysctl(adjnumclusters, MIBSIZE, 0, 0,
+ if (bkgrdsumadj == 0 || sysctl(adjnumclusters, MIBSIZE, 0, 0,
&cmd, sizeof cmd) == -1)
rwerror("ADJUST NUMBER OF FREE CLUSTERS", cmd.value);
}
OpenPOWER on IntegriCloud