summaryrefslogtreecommitdiff
path: root/ufs-fsck
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1996-07-18 19:11:03 +0000
committerMichael I. Bushnell <mib@gnu.org>1996-07-18 19:11:03 +0000
commit1a15cb8ff36fe1f23d927e43b5653ab68a1bfa7f (patch)
tree6c17febe937e0e8cb0baac69e472863391b9bcc3 /ufs-fsck
parentbe1fc488e93349d92fb30b1b4deb58fc2b118d56 (diff)
*** empty log message ***
Diffstat (limited to 'ufs-fsck')
-rw-r--r--ufs-fsck/ChangeLog5
-rw-r--r--ufs-fsck/pass2.c24
2 files changed, 29 insertions, 0 deletions
diff --git a/ufs-fsck/ChangeLog b/ufs-fsck/ChangeLog
index 1ea09c4a..cebead0c 100644
--- a/ufs-fsck/ChangeLog
+++ b/ufs-fsck/ChangeLog
@@ -1,3 +1,8 @@
+Thu Jul 18 14:55:14 1996 Michael I. Bushnell, p/BSG <mib@gnu.ai.mit.edu>
+
+ * pass2.c (pass2): If an entire directory block is null, allow
+ preen to patch it into a normal empty directory entry.
+
Sat Jul 6 19:59:27 1996 Miles Bader <miles@gnu.ai.mit.edu>
* main.c (argp_program_version): New variable.
diff --git a/ufs-fsck/pass2.c b/ufs-fsck/pass2.c
index 69331946..db63abd7 100644
--- a/ufs-fsck/pass2.c
+++ b/ufs-fsck/pass2.c
@@ -60,6 +60,30 @@ pass2 ()
if (dp->d_reclen == 0
|| dp->d_reclen + (void *)dp - buf > DIRBLKSIZ)
{
+ /* Perhaps the entire dir block is zero. UFS does that
+ when extending directories. So allow preening
+ to safely patch up all-null dir blocks. */
+ if (dp == buf)
+ {
+ char *bp;
+ for (bp = (char *)buf; bp < (char *)buf + DIRBLKSIZ; bp++)
+ if (*bp)
+ goto reclen_problem;
+
+ problem (0, "NULL BLOCK IN DIRECTORY");
+ if (preen || reply ("PATCH"))
+ {
+ /* Mark this entry free, and return. */
+ dp->d_ino = 0;
+ dp->d_reclen = DIRBLKSIZ;
+ pfix ("PATCHED");
+ return 1;
+ }
+ else
+ return mod;
+ }
+
+ reclen_problem:
problem (1, "BAD RECLEN IN DIRECTORY");
if (reply ("SALVAGE"))
{