[PATCH] xfs: don't run inodegc flushes when inodegc is not active

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Dave Chinner <dchinner@xxxxxxxxxx>

A flush trigger on a frozen filesystem (e.g. from statfs)
will run queued inactivations and assert fail like this:

XFS: Assertion failed: mp->m_super->s_writers.frozen < SB_FREEZE_FS, file: fs/xfs/xfs_icache.c, line: 1861

Bug exposed by xfs/011.

Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
---
 fs/xfs/xfs_icache.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
index 92006260fe90..f772f2a67a8b 100644
--- a/fs/xfs/xfs_icache.c
+++ b/fs/xfs/xfs_icache.c
@@ -1893,8 +1893,8 @@ xfs_inodegc_worker(
  * wait for the work to finish. Two pass - queue all the work first pass, wait
  * for it in a second pass.
  */
-void
-xfs_inodegc_flush(
+static void
+__xfs_inodegc_flush(
 	struct xfs_mount	*mp)
 {
 	struct xfs_inodegc	*gc;
@@ -1913,6 +1913,14 @@ xfs_inodegc_flush(
 	}
 }
 
+void
+xfs_inodegc_flush(
+	struct xfs_mount	*mp)
+{
+	if (xfs_is_inodegc_enabled(mp))
+		__xfs_inodegc_flush(mp);
+}
+
 /*
  * Flush all the pending work and then disable the inode inactivation background
  * workers and wait for them to stop.
@@ -1927,7 +1935,7 @@ xfs_inodegc_stop(
 	if (!xfs_clear_inodegc_enabled(mp))
 		return;
 
-	xfs_inodegc_flush(mp);
+	__xfs_inodegc_flush(mp);
 
 	for_each_online_cpu(cpu) {
 		gc = per_cpu_ptr(mp->m_inodegc, cpu);



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux