[PATCH 6/8] xfsprogs: xfs_db: unmount fs before exiting

Alex Elder aelder at sgi.com
Thu Nov 10 14:35:16 CST 2011


From: Kevan Rehm <kfr at sgi.com>

The main routine calls libxfs_mount() via init(), but never calls
libxfs_umount() at the end of the program so there could be
filesystem changes queued which never get flushed to disk.  This
adds the missing libxfs_umount() call.

Signed-off-by: Alex Elder <aelder at sgi.com>
---
 db/init.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/db/init.c b/db/init.c
index 2a5ef2b..5effaf9 100644
--- a/db/init.c
+++ b/db/init.c
@@ -170,7 +170,7 @@ main(
 	}
 	if (cmdline) {
 		xfree(cmdline);
-		return exitcode;
+		goto end;
 	}
 
 	while (!done) {
@@ -181,5 +181,9 @@ main(
 			done = command(c, v);
 		doneline(input, v);
 	}
+
+end:
+	libxfs_umount(mp);
+
 	return exitcode;
 }
-- 
1.7.6.4




More information about the xfs mailing list