All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] t_open_tmpfiles: flush log when shutting down filesystem
@ 2019-02-18 18:13 Darrick J. Wong
  0 siblings, 0 replies; only message in thread
From: Darrick J. Wong @ 2019-02-18 18:13 UTC (permalink / raw)
  To: Eryu Guan; +Cc: fstests, xfs, linux-ext4

From: Darrick J. Wong <darrick.wong@oracle.com>

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>
---
 src/t_open_tmpfiles.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/t_open_tmpfiles.c b/src/t_open_tmpfiles.c
index 9e70fbaa..da9390fd 100644
--- a/src/t_open_tmpfiles.c
+++ b/src/t_open_tmpfiles.c
@@ -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);

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-02-18 18:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-18 18:13 [PATCH] t_open_tmpfiles: flush log when shutting down filesystem Darrick J. Wong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.