public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs: Abort intent log item in xfs_iflush() upon error to get buf
@ 2016-04-12  6:57 Shyam Kaushik
  2016-04-12  8:28 ` Dave Chinner
  0 siblings, 1 reply; 6+ messages in thread
From: Shyam Kaushik @ 2016-04-12  6:57 UTC (permalink / raw)
  To: xfs

Looking at xfs_iflush(). If an IO fails, it is supposed to unlock the
inode by calling xfs_iflush_abort(), which will also remove it from
the AIL. This can also happen on reclaim of a dirty inode, and if so
we'll still reclaim the inode because reclaim assumes xfs_iflush()
cleans up properly. Which, apparently, it doesn't.

Fix xfs_iflush() buf get failure to remove intent log item.

Discovered-by: Dave Chinner <dchinner at redhat.com>
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index 96f606d..85414a6 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -3374,8 +3374,9 @@ xfs_iflush(
        error = xfs_imap_to_bp(mp, NULL, &ip->i_imap, &dip, &bp,
XBF_TRYLOCK,
                               0);
        if (error || !bp) {
-               xfs_ifunlock(ip);
-               return error;
+               if (!bp)
+                       error = -EIO;
+               goto abort_out;
        }

        /*
--

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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-04-13  4:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-12  6:57 [PATCH] xfs: Abort intent log item in xfs_iflush() upon error to get buf Shyam Kaushik
2016-04-12  8:28 ` Dave Chinner
2016-04-12 11:47   ` Shyam Kaushik
2016-04-12 17:40   ` Shyam Kaushik
2016-04-12 21:16     ` Dave Chinner
2016-04-13  4:02       ` Shyam Kaushik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox