|
Ian Kent |
2b02d9 |
autofs-5.0.5 - fix ext4 fsck at mount
|
|
Ian Kent |
2b02d9 |
|
|
Ian Kent |
2b02d9 |
From: Ian Kent <raven@themaw.net>
|
|
Ian Kent |
2b02d9 |
|
|
Ian Kent |
2b02d9 |
Autofs performs a "preen" fsck at max mount count for ext2 and ext3, but not
|
|
Ian Kent |
2b02d9 |
ext4.
|
|
Ian Kent |
2b02d9 |
---
|
|
Ian Kent |
2b02d9 |
|
|
Ian Kent |
f0c294 |
CHANGELOG | 1 +
|
|
Ian Kent |
2b02d9 |
Makefile.conf.in | 3 ++
|
|
Ian Kent |
f0c294 |
configure | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
Ian Kent |
f0c294 |
configure.in | 1 +
|
|
Ian Kent |
f0c294 |
include/config.h.in | 6 +++++
|
|
Ian Kent |
2b02d9 |
modules/Makefile | 10 ++++++--
|
|
Ian Kent |
f0c294 |
modules/mount_ext2.c | 11 +++++----
|
|
Ian Kent |
f0c294 |
7 files changed, 88 insertions(+), 7 deletions(-)
|
|
Ian Kent |
2b02d9 |
|
|
Ian Kent |
2b02d9 |
|
|
Ian Kent |
f0c294 |
diff --git a/CHANGELOG b/CHANGELOG
|
|
Ian Kent |
f0c294 |
index 8b62370..e37dadb 100644
|
|
Ian Kent |
f0c294 |
--- a/CHANGELOG
|
|
Ian Kent |
f0c294 |
+++ b/CHANGELOG
|
|
Ian Kent |
f0c294 |
@@ -8,6 +8,7 @@
|
|
Ian Kent |
f0c294 |
- more code analysis corrections (and fix a typo in an init script).
|
|
Ian Kent |
f0c294 |
- fix backwards #ifndef INET6.
|
|
Ian Kent |
f0c294 |
- fix stale initialization for file map instance.
|
|
Ian Kent |
f0c294 |
+- add "preen" fsck for ext4 mounts.
|
|
Ian Kent |
f0c294 |
|
|
Ian Kent |
f0c294 |
03/09/2009 autofs-5.0.5
|
|
Ian Kent |
f0c294 |
-----------------------
|
|
Ian Kent |
f0c294 |
diff --git a/Makefile.conf.in b/Makefile.conf.in
|
|
Ian Kent |
f0c294 |
index f0287c3..7670364 100644
|
|
Ian Kent |
f0c294 |
--- a/Makefile.conf.in
|
|
Ian Kent |
f0c294 |
+++ b/Makefile.conf.in
|
|
Ian Kent |
2b02d9 |
@@ -44,6 +44,9 @@ EXT2FS = @HAVE_E2FSCK@
|
|
Ian Kent |
2b02d9 |
# Support for calling e3fsck when mounting ext3 filesystems
|
|
Ian Kent |
2b02d9 |
EXT3FS = @HAVE_E3FSCK@
|
|
Ian Kent |
2b02d9 |
|
|
Ian Kent |
2b02d9 |
+# Support for calling e4fsck when mounting ext4 filesystems
|
|
Ian Kent |
2b02d9 |
+EXT4FS = @HAVE_E4FSCK@
|
|
Ian Kent |
2b02d9 |
+
|
|
Ian Kent |
2b02d9 |
LEX = @PATH_LEX@
|
|
Ian Kent |
2b02d9 |
YACC = @PATH_YACC@
|
|
Ian Kent |
2b02d9 |
RPCGEN = @PATH_RPCGEN@
|
|
Ian Kent |
f0c294 |
diff --git a/configure b/configure
|
|
Ian Kent |
f0c294 |
index 159f25f..f5b7d07 100755
|
|
Ian Kent |
f0c294 |
--- a/configure
|
|
Ian Kent |
f0c294 |
+++ b/configure
|
|
Ian Kent |
2b02d9 |
@@ -668,6 +668,8 @@ PATH_LEX
|
|
Ian Kent |
2b02d9 |
LEX
|
|
Ian Kent |
2b02d9 |
HAVE_MODPROBE
|
|
Ian Kent |
2b02d9 |
MODPROBE
|
|
Ian Kent |
2b02d9 |
+HAVE_E4FSCK
|
|
Ian Kent |
2b02d9 |
+E4FSCK
|
|
Ian Kent |
2b02d9 |
HAVE_E3FSCK
|
|
Ian Kent |
2b02d9 |
E3FSCK
|
|
Ian Kent |
2b02d9 |
HAVE_E2FSCK
|
|
Ian Kent |
2b02d9 |
@@ -3407,6 +3409,67 @@ else
|
|
Ian Kent |
2b02d9 |
HAVE_E3FSCK=0
|
|
Ian Kent |
2b02d9 |
fi
|
|
Ian Kent |
2b02d9 |
|
|
Ian Kent |
2b02d9 |
+for ac_prog in fsck.ext4 e4fsck
|
|
Ian Kent |
2b02d9 |
+do
|
|
Ian Kent |
2b02d9 |
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
|
|
Ian Kent |
2b02d9 |
+set dummy $ac_prog; ac_word=$2
|
|
Ian Kent |
2b02d9 |
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
|
|
Ian Kent |
2b02d9 |
+$as_echo_n "checking for $ac_word... " >&6; }
|
|
Ian Kent |
2b02d9 |
+if test "${ac_cv_path_E4FSCK+set}" = set; then
|
|
Ian Kent |
2b02d9 |
+ $as_echo_n "(cached) " >&6
|
|
Ian Kent |
2b02d9 |
+else
|
|
Ian Kent |
2b02d9 |
+ case $E4FSCK in
|
|
Ian Kent |
2b02d9 |
+ [\\/]* | ?:[\\/]*)
|
|
Ian Kent |
2b02d9 |
+ ac_cv_path_E4FSCK="$E4FSCK" # Let the user override the test with a path.
|
|
Ian Kent |
2b02d9 |
+ ;;
|
|
Ian Kent |
2b02d9 |
+ *)
|
|
Ian Kent |
2b02d9 |
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
|
Ian Kent |
2b02d9 |
+for as_dir in $searchpath
|
|
Ian Kent |
2b02d9 |
+do
|
|
Ian Kent |
2b02d9 |
+ IFS=$as_save_IFS
|
|
Ian Kent |
2b02d9 |
+ test -z "$as_dir" && as_dir=.
|
|
Ian Kent |
2b02d9 |
+ for ac_exec_ext in '' $ac_executable_extensions; do
|
|
Ian Kent |
2b02d9 |
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
|
|
Ian Kent |
2b02d9 |
+ ac_cv_path_E4FSCK="$as_dir/$ac_word$ac_exec_ext"
|
|
Ian Kent |
2b02d9 |
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
|
|
Ian Kent |
2b02d9 |
+ break 2
|
|
Ian Kent |
2b02d9 |
+ fi
|
|
Ian Kent |
2b02d9 |
+done
|
|
Ian Kent |
2b02d9 |
+done
|
|
Ian Kent |
2b02d9 |
+IFS=$as_save_IFS
|
|
Ian Kent |
2b02d9 |
+
|
|
Ian Kent |
2b02d9 |
+ ;;
|
|
Ian Kent |
2b02d9 |
+esac
|
|
Ian Kent |
2b02d9 |
+fi
|
|
Ian Kent |
2b02d9 |
+E4FSCK=$ac_cv_path_E4FSCK
|
|
Ian Kent |
2b02d9 |
+if test -n "$E4FSCK"; then
|
|
Ian Kent |
2b02d9 |
+ { $as_echo "$as_me:$LINENO: result: $E4FSCK" >&5
|
|
Ian Kent |
2b02d9 |
+$as_echo "$E4FSCK" >&6; }
|
|
Ian Kent |
2b02d9 |
+else
|
|
Ian Kent |
2b02d9 |
+ { $as_echo "$as_me:$LINENO: result: no" >&5
|
|
Ian Kent |
2b02d9 |
+$as_echo "no" >&6; }
|
|
Ian Kent |
2b02d9 |
+fi
|
|
Ian Kent |
2b02d9 |
+
|
|
Ian Kent |
2b02d9 |
+
|
|
Ian Kent |
2b02d9 |
+ test -n "$E4FSCK" && break
|
|
Ian Kent |
2b02d9 |
+done
|
|
Ian Kent |
2b02d9 |
+
|
|
Ian Kent |
2b02d9 |
+if test -n "$E4FSCK"; then
|
|
Ian Kent |
2b02d9 |
+
|
|
Ian Kent |
2b02d9 |
+cat >>confdefs.h <<\_ACEOF
|
|
Ian Kent |
2b02d9 |
+#define HAVE_E4FSCK 1
|
|
Ian Kent |
2b02d9 |
+_ACEOF
|
|
Ian Kent |
2b02d9 |
+
|
|
Ian Kent |
2b02d9 |
+
|
|
Ian Kent |
2b02d9 |
+cat >>confdefs.h <<_ACEOF
|
|
Ian Kent |
2b02d9 |
+#define PATH_E4FSCK "$E4FSCK"
|
|
Ian Kent |
2b02d9 |
+_ACEOF
|
|
Ian Kent |
2b02d9 |
+
|
|
Ian Kent |
2b02d9 |
+ HAVE_E4FSCK=1
|
|
Ian Kent |
2b02d9 |
+else
|
|
Ian Kent |
2b02d9 |
+ HAVE_E4FSCK=0
|
|
Ian Kent |
2b02d9 |
+fi
|
|
Ian Kent |
2b02d9 |
+
|
|
Ian Kent |
2b02d9 |
for ac_prog in modprobe
|
|
Ian Kent |
2b02d9 |
do
|
|
Ian Kent |
2b02d9 |
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
|
Ian Kent |
f0c294 |
diff --git a/configure.in b/configure.in
|
|
Ian Kent |
f0c294 |
index f649a58..78085bd 100644
|
|
Ian Kent |
f0c294 |
--- a/configure.in
|
|
Ian Kent |
f0c294 |
+++ b/configure.in
|
|
Ian Kent |
f0c294 |
@@ -131,6 +131,7 @@ AF_PATH_INCLUDE(MOUNT, mount, /bin/mount, $searchpath)
|
|
Ian Kent |
2b02d9 |
AF_PATH_INCLUDE(UMOUNT, umount, /bin/umount, $searchpath)
|
|
Ian Kent |
2b02d9 |
AF_PATH_INCLUDE(E2FSCK, fsck.ext2 e2fsck, , $searchpath)
|
|
Ian Kent |
2b02d9 |
AF_PATH_INCLUDE(E3FSCK, fsck.ext3 e3fsck, , $searchpath)
|
|
Ian Kent |
2b02d9 |
+AF_PATH_INCLUDE(E4FSCK, fsck.ext4 e4fsck, , $searchpath)
|
|
Ian Kent |
2b02d9 |
AF_PATH_INCLUDE(MODPROBE, modprobe, , $searchpath)
|
|
Ian Kent |
2b02d9 |
|
|
Ian Kent |
2b02d9 |
AF_CHECK_PROG(LEX, flex lex, , $searchpath)
|
|
Ian Kent |
f0c294 |
diff --git a/include/config.h.in b/include/config.h.in
|
|
Ian Kent |
f0c294 |
index 39cfa4b..dece33f 100644
|
|
Ian Kent |
f0c294 |
--- a/include/config.h.in
|
|
Ian Kent |
f0c294 |
+++ b/include/config.h.in
|
|
Ian Kent |
2b02d9 |
@@ -18,6 +18,9 @@
|
|
Ian Kent |
2b02d9 |
/* define if you have E3FSCK */
|
|
Ian Kent |
2b02d9 |
#undef HAVE_E3FSCK
|
|
Ian Kent |
2b02d9 |
|
|
Ian Kent |
2b02d9 |
+/* define if you have E4FSCK */
|
|
Ian Kent |
2b02d9 |
+#undef HAVE_E4FSCK
|
|
Ian Kent |
2b02d9 |
+
|
|
Ian Kent |
2b02d9 |
/* Define to 1 if you have the <inttypes.h> header file. */
|
|
Ian Kent |
2b02d9 |
#undef HAVE_INTTYPES_H
|
|
Ian Kent |
2b02d9 |
|
|
Ian Kent |
2b02d9 |
@@ -93,6 +96,9 @@
|
|
Ian Kent |
2b02d9 |
/* define if you have E3FSCK */
|
|
Ian Kent |
2b02d9 |
#undef PATH_E3FSCK
|
|
Ian Kent |
2b02d9 |
|
|
Ian Kent |
2b02d9 |
+/* define if you have E4FSCK */
|
|
Ian Kent |
2b02d9 |
+#undef PATH_E4FSCK
|
|
Ian Kent |
2b02d9 |
+
|
|
Ian Kent |
2b02d9 |
/* define if you have LEX */
|
|
Ian Kent |
2b02d9 |
#undef PATH_LEX
|
|
Ian Kent |
2b02d9 |
|
|
Ian Kent |
f0c294 |
diff --git a/modules/Makefile b/modules/Makefile
|
|
Ian Kent |
f0c294 |
index 13b3bd8..0bb9464 100644
|
|
Ian Kent |
f0c294 |
--- a/modules/Makefile
|
|
Ian Kent |
f0c294 |
+++ b/modules/Makefile
|
|
Ian Kent |
2b02d9 |
@@ -69,10 +69,16 @@ ifeq ($(EXT2FS), 1)
|
|
Ian Kent |
2b02d9 |
ifeq ($(EXT3FS), 1)
|
|
Ian Kent |
2b02d9 |
ln -fs mount_ext2.so $(INSTALLROOT)$(autofslibdir)/mount_ext3.so
|
|
Ian Kent |
2b02d9 |
endif
|
|
Ian Kent |
2b02d9 |
-else
|
|
Ian Kent |
2b02d9 |
- ifeq ($(EXT3FS), 1)
|
|
Ian Kent |
2b02d9 |
+ ifeq ($(EXT4FS), 1)
|
|
Ian Kent |
2b02d9 |
+ ln -fs mount_ext2.so $(INSTALLROOT)$(autofslibdir)/mount_ext4.so
|
|
Ian Kent |
2b02d9 |
+ endif
|
|
Ian Kent |
2b02d9 |
+else ifeq ($(EXT3FS), 1)
|
|
Ian Kent |
2b02d9 |
mv $(INSTALLROOT)$(autofslibdir)/mount_ext2.so $(INSTALLROOT)$(autofslibdir)/mount_ext3.so
|
|
Ian Kent |
2b02d9 |
+ ifeq ($(EXT4FS), 1)
|
|
Ian Kent |
2b02d9 |
+ ln -fs mount_ext3.so $(INSTALLROOT)$(autofslibdir)/mount_ext4.so
|
|
Ian Kent |
2b02d9 |
endif
|
|
Ian Kent |
2b02d9 |
+else ifeq ($(EXT4FS), 1)
|
|
Ian Kent |
2b02d9 |
+ mv $(INSTALLROOT)$(autofslibdir)/mount_ext2.so $(INSTALLROOT)$(autofslibdir)/mount_ext4.so
|
|
Ian Kent |
2b02d9 |
endif
|
|
Ian Kent |
2b02d9 |
|
|
Ian Kent |
2b02d9 |
#
|
|
Ian Kent |
f0c294 |
diff --git a/modules/mount_ext2.c b/modules/mount_ext2.c
|
|
Ian Kent |
f0c294 |
index 724a5fa..26d59d1 100644
|
|
Ian Kent |
f0c294 |
--- a/modules/mount_ext2.c
|
|
Ian Kent |
f0c294 |
+++ b/modules/mount_ext2.c
|
|
Ian Kent |
f0c294 |
@@ -83,13 +83,14 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int
|
|
Ian Kent |
2b02d9 |
ro = 1;
|
|
Ian Kent |
2b02d9 |
}
|
|
Ian Kent |
2b02d9 |
|
|
Ian Kent |
2b02d9 |
+ fsck_prog = PATH_E2FSCK;
|
|
Ian Kent |
2b02d9 |
#ifdef HAVE_E3FSCK
|
|
Ian Kent |
2b02d9 |
- if (!strcmp(fstype,"ext3") || !strcmp(fstype,"auto"))
|
|
Ian Kent |
2b02d9 |
+ if (!strcmp(fstype,"ext3"))
|
|
Ian Kent |
2b02d9 |
fsck_prog = PATH_E3FSCK;
|
|
Ian Kent |
2b02d9 |
- else
|
|
Ian Kent |
2b02d9 |
- fsck_prog = PATH_E2FSCK;
|
|
Ian Kent |
2b02d9 |
-#else
|
|
Ian Kent |
2b02d9 |
- fsck_prog = PATH_E2FSCK;
|
|
Ian Kent |
2b02d9 |
+#endif
|
|
Ian Kent |
2b02d9 |
+#ifdef HAVE_E4FSCK
|
|
Ian Kent |
2b02d9 |
+ if (!strcmp(fstype,"ext4"))
|
|
Ian Kent |
2b02d9 |
+ fsck_prog = PATH_E4FSCK;
|
|
Ian Kent |
2b02d9 |
#endif
|
|
Ian Kent |
2b02d9 |
if (ro) {
|
|
Ian Kent |
2b02d9 |
debug(ap->logopt,
|