All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shyam Kaushik <shyam@zadarastorage.com>
To: xfs@oss.sgi.com
Subject: [PATCH] xfs: Abort intent log item in xfs_iflush() upon error to get buf
Date: Tue, 12 Apr 2016 12:27:30 +0530	[thread overview]
Message-ID: <23e35813cb097c7b15686852500cbf97@mail.gmail.com> (raw)

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

             reply	other threads:[~2016-04-12  6:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-12  6:57 Shyam Kaushik [this message]
2016-04-12  8:28 ` [PATCH] xfs: Abort intent log item in xfs_iflush() upon error to get buf 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

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=23e35813cb097c7b15686852500cbf97@mail.gmail.com \
    --to=shyam@zadarastorage.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 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.