public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Tinguely <tinguely@sgi.com>
To: xfs@oss.sgi.com
Subject: [PATCH 4/5] xfs: free inodes on log recovery error
Date: Wed, 02 Jul 2014 09:32:10 -0500	[thread overview]
Message-ID: <20140702144139.894251516@sgi.com> (raw)
In-Reply-To: 20140702143206.438456679@sgi.com

[-- Attachment #1: xfs-reclaim-inodes-on-recovery-fail.patch --]
[-- Type: text/plain, Size: 1455 bytes --]

Recovery may free inodes that end up on the inode
reclaim RCU. If recovery fails, we leak these inodes.
The filesystem should be in forced shutdown at this
point, so a call to xfs_reclaim_inode is a fast path
to freeing the inodes and RCU entries.

Signed-off-by: Mark Tinguely <tinguely@sgi.com>
---
 fs/xfs/xfs_log.c   |    2 ++
 fs/xfs/xfs_mount.c |    1 +
 2 files changed, 3 insertions(+)

Index: b/fs/xfs/xfs_log.c
===================================================================
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -31,6 +31,7 @@
 #include "xfs_log_priv.h"
 #include "xfs_log_recover.h"
 #include "xfs_inode.h"
+#include "xfs_icache.h"
 #include "xfs_trace.h"
 #include "xfs_fsops.h"
 #include "xfs_cksum.h"
@@ -720,6 +721,7 @@ xfs_log_mount(
 	return 0;
 
 out_destroy_ail:
+	xfs_reclaim_inodes(mp, SYNC_WAIT);
 	xfs_trans_ail_destroy(mp);
 out_free_log:
 	xlog_dealloc_log(mp->m_log);
Index: b/fs/xfs/xfs_mount.c
===================================================================
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -980,6 +980,7 @@ xfs_mountfs(
  out_log_dealloc:
 	xfs_log_unmount(mp);
  out_fail_wait:
+	xfs_reclaim_inodes(mp, SYNC_WAIT);
 	if (mp->m_logdev_targp && mp->m_logdev_targp != mp->m_ddev_targp)
 		xfs_wait_buftarg(mp->m_logdev_targp);
 	xfs_wait_buftarg(mp->m_ddev_targp);


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  parent reply	other threads:[~2014-07-02 14:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-02 14:32 [PATCH 0/5] Misc controversial patches Mark Tinguely
2014-07-02 14:32 ` [PATCH 1/5] xfs: remove efi from AIL in log recovery Mark Tinguely
2014-07-07 14:30   ` Brian Foster
2014-07-07 15:29     ` Mark Tinguely
2014-07-07 23:44       ` Dave Chinner
2014-07-02 14:32 ` [PATCH 2/5] xfs: free the EFI entries from AIL on forced shutdown Mark Tinguely
2014-07-02 14:32 ` [PATCH 3/5] xfs: free the list of recovery items on error Mark Tinguely
2014-07-02 14:32 ` Mark Tinguely [this message]
2014-07-07 14:30   ` [PATCH 4/5] xfs: free inodes on log recovery error Brian Foster
2014-07-07 15:18     ` Mark Tinguely
2014-07-09  9:02   ` Christoph Hellwig
2014-07-02 14:32 ` [PATCH 5/5] xfs: fix cil push sequence after log recovery Mark Tinguely
2014-07-07 15:26   ` Brian Foster

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=20140702144139.894251516@sgi.com \
    --to=tinguely@sgi.com \
    --cc=xfs@oss.sgi.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox