From d61f6176024865007d5a0da49c61c21e9d498007 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sat, 27 May 2000 16:04:00 +0000 Subject: [PATCH] Makefile.in: Fix stupid dependency bug. ChangeLog, debugfs.c, debugfs.h, util.c: debugfs.c (do_testb, do_testi): Call check_fs_bitmaps to avoid coredumping if the bitmaps aren't loaded. util.c (check_fs_bitmaps): New function which checks whether or not the bitmaps are loaded. --- debugfs/ChangeLog | 8 ++++++++ debugfs/debugfs.c | 4 ++++ debugfs/debugfs.h | 1 + debugfs/util.c | 14 ++++++++++++++ lib/uuid/Makefile.in | 2 +- 5 files changed, 28 insertions(+), 1 deletion(-) diff --git a/debugfs/ChangeLog b/debugfs/ChangeLog index ae9e3b7..eda81e9 100644 --- a/debugfs/ChangeLog +++ b/debugfs/ChangeLog @@ -1,3 +1,11 @@ +2000-05-27 Theodore Ts'o + + * debugfs.c (do_testb, do_testi): Call check_fs_bitmaps to avoid + coredumping if the bitmaps aren't loaded. + + * util.c (check_fs_bitmaps): New function which checks whether or + not the bitmaps are loaded. + 2000-05-23 Aaron Crane * debugfs.8.in: Documented new behaviour. diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c index 1a93d58..46471d1 100644 --- a/debugfs/debugfs.c +++ b/debugfs/debugfs.c @@ -612,6 +612,8 @@ void do_testi(int argc, char *argv[]) } if (check_fs_open(argv[0])) return; + if (check_fs_bitmaps(argv[0])) + return; inode = string_to_inode(argv[1]); if (!inode) return; @@ -682,6 +684,8 @@ void do_testb(int argc, char *argv[]) } if (check_fs_open(argv[0])) return; + if (check_fs_bitmaps(argv[0])) + return; block = strtoul(argv[1], &tmp, 0); if (!block || *tmp) { com_err(argv[0], 0, "No block 0"); diff --git a/debugfs/debugfs.h b/debugfs/debugfs.h index f2917e1..f5d3d53 100644 --- a/debugfs/debugfs.h +++ b/debugfs/debugfs.h @@ -20,6 +20,7 @@ extern void close_pager(FILE *stream); extern int check_fs_open(char *name); extern int check_fs_not_open(char *name); extern int check_fs_read_write(char *name); +extern int check_fs_bitmaps(char *name); extern ino_t string_to_inode(char *str); extern char *time_to_string(__u32); diff --git a/debugfs/util.c b/debugfs/util.c index c8eeae1..66a0bea 100644 --- a/debugfs/util.c +++ b/debugfs/util.c @@ -107,6 +107,20 @@ int check_fs_read_write(char *name) } /* + * This routine returns 1 if a filesystem is doesn't have its inode + * and block bitmaps loaded, and prints an error message to that + * effect. + */ +int check_fs_bitmaps(char *name) +{ + if (!current_fs->block_map || !current_fs->inode_map) { + com_err(name, 0, "Filesystem bitmaps not loaded"); + return 1; + } + return 0; +} + +/* * This function takes a __u32 time value and converts it to a string, * using ctime */ diff --git a/lib/uuid/Makefile.in b/lib/uuid/Makefile.in index 990df13..0404e87 100644 --- a/lib/uuid/Makefile.in +++ b/lib/uuid/Makefile.in @@ -157,7 +157,7 @@ distclean:: clean # Hack to parallel makes recognize dependencies correctly. # ../../lib/libuuid.a: libuuid.a -../../lib/libuuid.so: libuuid.so +../../lib/libuuid.so: image # +++ Dependency line eater +++ # -- 1.8.3.1