xfs
[Top] [All Lists]

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

To: xfs@xxxxxxxxxxx
Subject: [PATCH 6/8] xfsprogs: xfs_db: unmount fs before exiting
From: Alex Elder <aelder@xxxxxxx>
Date: Thu, 10 Nov 2011 14:35:16 -0600
Cc: Kevan Rehm <kfr@xxxxxxx>, Alex Elder <aelder@xxxxxxx>
In-reply-to: <1320957318-16269-1-git-send-email-aelder@xxxxxxx>
In-reply-to: <3ed89446f6dc1231ec1de712f242522052952b7e.1320955675.git.aelder@xxxxxxx>
References: <1320957318-16269-1-git-send-email-aelder@xxxxxxx>
References: <3ed89446f6dc1231ec1de712f242522052952b7e.1320955675.git.aelder@xxxxxxx>
From: Kevan Rehm <kfr@xxxxxxx>

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@xxxxxxx>
---
 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

<Prev in Thread] Current Thread [Next in Thread>