From: Shyam Kaushik <shyam@zadarastorage.com>
To: xfs@oss.sgi.com
Cc: Alex Lyakas <alex@zadarastorage.com>
Subject: [PATCH] xfs_buf_iodone_callbacks to force shutdown & resubmit buf in case of permanent failure
Date: Tue, 26 Apr 2016 19:31:59 +0530 [thread overview]
Message-ID: <a71e1aed74b2922e8ed6fb40404899e7@mail.gmail.com> (raw)
When XFS underlying disk fails, it could take several milliseconds for the
FS to be marked
shutdown. xfs_buf_iodone_callbacks() retries buf upon first failure by
submitting it once
again. But if the buf fails 2nd time before FS is marked for shutdown, it
just releases the
buf with xfs_buf_relse(). This is flawed that nobody is releasing the
XFS_IFLOCK on the inode.
Because of this AIL tasks repeated effort to xfs_inode_item_push() will
see that xfs_iflock()
cannot be acquired. This blocks XFS from being unmounted as
xfs_ail_push_all_sync() will keep
looping without progress.
Fix this by marking the FS for shutdown if we have a permanent failure &
resubmit the buf.
xfs_buf_submit() will see FS marked for shutdown & invoke the callback
which releases
XFS_IFLOCK.
diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c
index 1a6c9b9..6f73ee0 100644
--- a/fs/xfs/xfs_buf_item.c
+++ b/fs/xfs/xfs_buf_item.c
@@ -1100,7 +1100,12 @@ xfs_buf_iodone_callbacks(
XBF_DONE | XBF_WRITE_FAIL;
xfs_buf_submit(bp);
} else {
- xfs_buf_relse(bp);
+ /*
+ * if we have the buf fail 2nd time, force a FS
shutdown & resubmit
+ * the buf for it to be failed back immediately
+ */
+ xfs_force_shutdown(mp, SHUTDOWN_LOG_IO_ERROR);
+ xfs_buf_submit(bp);
}
return;
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next reply other threads:[~2016-04-26 14:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-26 14:01 Shyam Kaushik [this message]
2016-04-26 22:46 ` [PATCH] xfs_buf_iodone_callbacks to force shutdown & resubmit buf in case of permanent failure Dave Chinner
2016-04-27 4:59 ` Shyam Kaushik
2016-04-27 23:53 ` Dave Chinner
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=a71e1aed74b2922e8ed6fb40404899e7@mail.gmail.com \
--to=shyam@zadarastorage.com \
--cc=alex@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.