From: Brian Foster <bfoster@redhat.com>
To: linux-xfs@vger.kernel.org
Subject: [RFC v2 PATCH 3/3] xfs: automatically relog quotaoff start intent
Date: Fri, 22 Nov 2019 13:19:27 -0500 [thread overview]
Message-ID: <20191122181927.32870-4-bfoster@redhat.com> (raw)
In-Reply-To: <20191122181927.32870-1-bfoster@redhat.com>
Signed-off-by: Brian Foster <bfoster@redhat.com>
---
fs/xfs/libxfs/xfs_trans_resv.c | 3 ++-
fs/xfs/xfs_dquot_item.c | 13 +++++++++++++
fs/xfs/xfs_qm_syscalls.c | 9 ++++++++-
3 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/fs/xfs/libxfs/xfs_trans_resv.c b/fs/xfs/libxfs/xfs_trans_resv.c
index c55cd9a3dec9..88e222d0947a 100644
--- a/fs/xfs/libxfs/xfs_trans_resv.c
+++ b/fs/xfs/libxfs/xfs_trans_resv.c
@@ -866,7 +866,8 @@ xfs_trans_resv_calc(
resp->tr_qm_setqlim.tr_logcount = XFS_DEFAULT_LOG_COUNT;
resp->tr_qm_quotaoff.tr_logres = xfs_calc_qm_quotaoff_reservation(mp);
- resp->tr_qm_quotaoff.tr_logcount = XFS_DEFAULT_LOG_COUNT;
+ resp->tr_qm_quotaoff.tr_logcount = XFS_DEFAULT_PERM_LOG_COUNT;
+ resp->tr_qm_quotaoff.tr_logflags |= XFS_TRANS_PERM_LOG_RES;
resp->tr_qm_equotaoff.tr_logres =
xfs_calc_qm_quotaoff_end_reservation();
diff --git a/fs/xfs/xfs_dquot_item.c b/fs/xfs/xfs_dquot_item.c
index d60647d7197b..57b7c9b731b1 100644
--- a/fs/xfs/xfs_dquot_item.c
+++ b/fs/xfs/xfs_dquot_item.c
@@ -288,6 +288,18 @@ xfs_qm_qoff_logitem_format(
xlog_finish_iovec(lv, vecp, sizeof(struct xfs_qoff_logitem));
}
+/*
+ * XXX: simulate relog callback with hardcoded ->iop_committed() callback
+ */
+static xfs_lsn_t
+xfs_qm_qoff_logitem_committed(
+ struct xfs_log_item *lip,
+ xfs_lsn_t lsn)
+{
+ xfs_trans_relog_queue(lip);
+ return lsn;
+}
+
/*
* There isn't much you can do to push a quotaoff item. It is simply
* stuck waiting for the log to be flushed to disk.
@@ -333,6 +345,7 @@ static const struct xfs_item_ops xfs_qm_qoffend_logitem_ops = {
static const struct xfs_item_ops xfs_qm_qoff_logitem_ops = {
.iop_size = xfs_qm_qoff_logitem_size,
.iop_format = xfs_qm_qoff_logitem_format,
+ .iop_committed = xfs_qm_qoff_logitem_committed,
.iop_push = xfs_qm_qoff_logitem_push,
};
diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c
index 1ea82764bf89..3f15f8576027 100644
--- a/fs/xfs/xfs_qm_syscalls.c
+++ b/fs/xfs/xfs_qm_syscalls.c
@@ -18,6 +18,7 @@
#include "xfs_quota.h"
#include "xfs_qm.h"
#include "xfs_icache.h"
+#include "xfs_log.h"
STATIC int
xfs_qm_log_quotaoff(
@@ -50,7 +51,7 @@ xfs_qm_log_quotaoff(
* We don't care about quotoff's performance.
*/
xfs_trans_set_sync(tp);
- error = xfs_trans_commit(tp);
+ error = xfs_trans_relog(tp, &qoffi->qql_item);
if (error)
goto out;
@@ -227,7 +228,13 @@ xfs_qm_scall_quotaoff(
*
* So, we have QUOTAOFF start and end logitems; the start
* logitem won't get overwritten until the end logitem appears...
+ *
+ * XXX: qoffend expects qoffstart in the AIL but not in the CIL. Force
+ * the log after cancelling relogging to prevent item reinsert...
*/
+ //ssleep(3);
+ xfs_trans_relog_cancel(&qoffstart->qql_item);
+ xfs_log_force(mp, XFS_LOG_SYNC);
error = xfs_qm_log_quotaoff_end(mp, qoffstart, flags);
if (error) {
/* We're screwed now. Shutdown is the only option. */
--
2.20.1
next prev parent reply other threads:[~2019-11-22 18:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-22 18:19 [RFC v2 PATCH 0/3] xfs: automatic relogging experiment Brian Foster
2019-11-22 18:19 ` [RFC v2 PATCH 1/3] xfs: set t_task at wait time instead of alloc time Brian Foster
2019-11-22 18:19 ` [RFC v2 PATCH 2/3] xfs: prototype automatic intent relogging mechanism Brian Foster
2019-11-22 18:19 ` Brian Foster [this message]
2019-11-25 18:55 ` [RFC v3 PATCH] xfs: automatic relogging experiment Brian Foster
2019-11-27 15:12 ` 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=20191122181927.32870-4-bfoster@redhat.com \
--to=bfoster@redhat.com \
--cc=linux-xfs@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).