From: Bob Peterson <rpeterso@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 05/15] gfs2: Allow some glocks to be used during withdraw
Date: Wed, 27 Feb 2019 13:55:36 -0700 [thread overview]
Message-ID: <20190227205546.26828-6-rpeterso@redhat.com> (raw)
In-Reply-To: <20190227205546.26828-1-rpeterso@redhat.com>
Before this patch, when a file system was withdrawn, all further
attempts to enqueue or promote glocks were rejected and returned
-EIO. This is only important for media-backed glocks like inode
and rgrp glocks. All other glocks may be safely used because there
is no potential for metadata corruption. This patch allows some
glocks to be used even after the file system is withdrawn. This
is accomplished with a new glops flag, GLOF_OK_AT_WITHDRAW. This
facilitates future patches that enhance fs withdraw.
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
---
fs/gfs2/glock.c | 4 +++-
fs/gfs2/glops.c | 8 ++++++--
fs/gfs2/incore.h | 1 +
3 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index c6d6e478f5e3..25923b9e18ef 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -543,6 +543,7 @@ __acquires(&gl->gl_lockref.lock)
int ret;
if (unlikely(withdrawn(sdp)) &&
+ !(glops->go_flags & GLOF_OK_AT_WITHDRAW) &&
target != LM_ST_UNLOCKED)
return;
lck_flags &= (LM_FLAG_TRY | LM_FLAG_TRY_1CB | LM_FLAG_NOEXP |
@@ -1091,7 +1092,8 @@ int gfs2_glock_nq(struct gfs2_holder *gh)
struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
int error = 0;
- if (unlikely(withdrawn(sdp)))
+ if (unlikely(withdrawn(sdp)) &&
+ !(gl->gl_ops->go_flags & GLOF_OK_AT_WITHDRAW))
return -EIO;
if (test_bit(GLF_LRU, &gl->gl_flags))
diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c
index 9c86c8004ba7..4ba0f21aa312 100644
--- a/fs/gfs2/glops.c
+++ b/fs/gfs2/glops.c
@@ -583,6 +583,7 @@ static void iopen_go_callback(struct gfs2_glock *gl, bool remote)
const struct gfs2_glock_operations gfs2_meta_glops = {
.go_type = LM_TYPE_META,
+ .go_flags = GLOF_OK_AT_WITHDRAW,
};
const struct gfs2_glock_operations gfs2_inode_glops = {
@@ -610,6 +611,7 @@ const struct gfs2_glock_operations gfs2_freeze_glops = {
.go_xmote_bh = freeze_go_xmote_bh,
.go_demote_ok = freeze_go_demote_ok,
.go_type = LM_TYPE_NONDISK,
+ .go_flags = GLOF_OK_AT_WITHDRAW,
};
const struct gfs2_glock_operations gfs2_iopen_glops = {
@@ -620,20 +622,22 @@ const struct gfs2_glock_operations gfs2_iopen_glops = {
const struct gfs2_glock_operations gfs2_flock_glops = {
.go_type = LM_TYPE_FLOCK,
- .go_flags = GLOF_LRU,
+ .go_flags = GLOF_LRU | GLOF_OK_AT_WITHDRAW,
};
const struct gfs2_glock_operations gfs2_nondisk_glops = {
.go_type = LM_TYPE_NONDISK,
+ .go_flags = GLOF_OK_AT_WITHDRAW,
};
const struct gfs2_glock_operations gfs2_quota_glops = {
.go_type = LM_TYPE_QUOTA,
- .go_flags = GLOF_LVB | GLOF_LRU,
+ .go_flags = GLOF_LVB | GLOF_LRU | GLOF_OK_AT_WITHDRAW,
};
const struct gfs2_glock_operations gfs2_journal_glops = {
.go_type = LM_TYPE_JOURNAL,
+ .go_flags = GLOF_OK_AT_WITHDRAW,
};
const struct gfs2_glock_operations *gfs2_glops_list[] = {
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h
index c6984265807f..d84430eceb6c 100644
--- a/fs/gfs2/incore.h
+++ b/fs/gfs2/incore.h
@@ -250,6 +250,7 @@ struct gfs2_glock_operations {
#define GLOF_ASPACE 1
#define GLOF_LVB 2
#define GLOF_LRU 4
+#define GLOF_OK_AT_WITHDRAW 8
};
enum {
--
2.20.1
next prev parent reply other threads:[~2019-02-27 20:55 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-27 20:55 [Cluster-devel] [PATCH 00/15] GFS2: Withdraw corruption patches [V2] Bob Peterson
2019-02-27 20:55 ` [Cluster-devel] [PATCH 01/15] gfs2: log error reform Bob Peterson
2019-02-27 20:55 ` [Cluster-devel] [PATCH 02/15] gfs2: Introduce concept of a pending withdraw Bob Peterson
2019-02-27 20:55 ` [Cluster-devel] [PATCH 03/15] gfs2: Ignore recovery attempts if gfs2 has io error or is withdrawn Bob Peterson
2019-02-27 20:55 ` [Cluster-devel] [PATCH 04/15] gfs2: move check_journal_clean to util.c for future use Bob Peterson
2019-02-27 20:55 ` Bob Peterson [this message]
2019-02-27 20:55 ` [Cluster-devel] [PATCH 06/15] gfs2: Make secondary withdrawers wait for first withdrawer Bob Peterson
2019-02-27 20:55 ` [Cluster-devel] [PATCH 07/15] gfs2: Don't write log headers after file system withdraw Bob Peterson
2019-02-27 20:55 ` [Cluster-devel] [PATCH 08/15] gfs2: Force withdraw to replay journals and wait for it to finish Bob Peterson
2019-02-27 20:55 ` [Cluster-devel] [PATCH 09/15] gfs2: Add verbose option to check_journal_clean Bob Peterson
2019-02-27 20:55 ` [Cluster-devel] [PATCH 10/15] gfs2: Check for log write errors before telling dlm to unlock Bob Peterson
2019-02-27 20:55 ` [Cluster-devel] [PATCH 11/15] gfs2: Do log_flush in gfs2_ail_empty_gl even if ail list is empty Bob Peterson
2019-02-27 20:55 ` [Cluster-devel] [PATCH 12/15] gfs2: If the journal isn't live ignore log flushes Bob Peterson
2019-02-27 20:55 ` [Cluster-devel] [PATCH 13/15] gfs2: Issue revokes more intelligently Bob Peterson
2019-02-27 20:55 ` [Cluster-devel] [PATCH 14/15] gfs2: Warn when a journal replay overwrites a rgrp with buffers Bob Peterson
2019-02-27 20:55 ` [Cluster-devel] [PATCH 15/15] gfs2: log which portion of the journal is replayed Bob Peterson
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=20190227205546.26828-6-rpeterso@redhat.com \
--to=rpeterso@redhat.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;
as well as URLs for NNTP newsgroup(s).