]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
src/t_open_tmpfiles: flush log when shutting down filesystem
authorDarrick J. Wong <darrick.wong@oracle.com>
Mon, 18 Feb 2019 18:13:59 +0000 (10:13 -0800)
committerEryu Guan <guaneryu@gmail.com>
Thu, 21 Feb 2019 01:48:27 +0000 (09:48 +0800)
If the caller of t_open_tmpfiles wants to shut down the filesystem,
be sure to flush the log when we shut down so that log recovery will
have to process all the unlinked temporary files.

This is apparently needed to force ext4 to flush updated inode
blocks through the journal at all.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
src/t_open_tmpfiles.c

index 9e70fbaa76e63f331609066ff8bb789d7ff81c37..da9390fd872940a3e364828e37108bcf438ceebb 100644 (file)
@@ -70,7 +70,11 @@ void die(void)
                fflush(stdout);
 
                if (shutdown_fs) {
-                       int flag = XFS_FSOP_GOING_FLAGS_NOLOGFLUSH;
+                       /*
+                        * Flush the log so that we have to process the
+                        * unlinked inodes the next time we mount.
+                        */
+                       int flag = XFS_FSOP_GOING_FLAGS_LOGFLUSH;
                        int ret;
 
                        ret = ioctl(min_fd, XFS_IOC_GOINGDOWN, &flag);