All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Eryu Guan <guaneryu@gmail.com>
Cc: fstests <fstests@vger.kernel.org>,
	xfs <linux-xfs@vger.kernel.org>,
	linux-ext4 <linux-ext4@vger.kernel.org>
Subject: [PATCH] t_open_tmpfiles: flush log when shutting down filesystem
Date: Mon, 18 Feb 2019 10:13:59 -0800	[thread overview]
Message-ID: <20190218181359.GG6477@magnolia> (raw)

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);

                 reply	other threads:[~2019-02-18 18:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190218181359.GG6477@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=fstests@vger.kernel.org \
    --cc=guaneryu@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.