From: "Yan, Zheng" <zyan@redhat.com>
To: ceph-devel@vger.kernel.org
Cc: jlayton@kernel.org, "Yan, Zheng" <zyan@redhat.com>
Subject: [PATCH] ceph: properly wake up cap waiter after releasing revoked caps
Date: Mon, 11 May 2020 16:25:12 +0800 [thread overview]
Message-ID: <20200511082512.4375-1-zyan@redhat.com> (raw)
arg->wake can never be true. the bug was introduced by commit
0c4b255369bcf "ceph: reorganize __send_cap for less spinlock abuse"
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
---
fs/ceph/caps.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index b3e65c89ba6e..a2a2cda117e0 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -1376,6 +1376,12 @@ static void __prep_cap(struct cap_msg_args *arg, struct ceph_cap *cap,
ci->i_ceph_flags &= ~CEPH_I_FLUSH;
cap->issued &= retain; /* drop bits we don't want */
+ /*
+ * Wake up any waiters on wanted -> needed transition. This is due to
+ * the weird transition from buffered to sync IO... we need to flush
+ * dirty pages _before_ allowing sync writes to avoid reordering.
+ */
+ arg->wake = cap->implemented & ~cap->issued;
cap->implemented &= cap->issued | used;
cap->mds_wanted = want;
@@ -1439,13 +1445,6 @@ static void __prep_cap(struct cap_msg_args *arg, struct ceph_cap *cap,
}
}
arg->flags = flags;
-
- /*
- * Wake up any waiters on wanted -> needed transition. This is due to
- * the weird transition from buffered to sync IO... we need to flush
- * dirty pages _before_ allowing sync writes to avoid reordering.
- */
- arg->wake = cap->implemented & ~cap->issued;
}
/*
--
2.21.3
next reply other threads:[~2020-05-11 8:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-11 8:25 Yan, Zheng [this message]
2020-05-11 11:28 ` [PATCH] ceph: properly wake up cap waiter after releasing revoked caps Jeff Layton
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=20200511082512.4375-1-zyan@redhat.com \
--to=zyan@redhat.com \
--cc=ceph-devel@vger.kernel.org \
--cc=jlayton@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 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.