* [PATCH] ceph: properly wake up cap waiter after releasing revoked caps
@ 2020-05-11 8:25 Yan, Zheng
2020-05-11 11:28 ` Jeff Layton
0 siblings, 1 reply; 2+ messages in thread
From: Yan, Zheng @ 2020-05-11 8:25 UTC (permalink / raw)
To: ceph-devel; +Cc: jlayton, Yan, Zheng
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ceph: properly wake up cap waiter after releasing revoked caps
2020-05-11 8:25 [PATCH] ceph: properly wake up cap waiter after releasing revoked caps Yan, Zheng
@ 2020-05-11 11:28 ` Jeff Layton
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Layton @ 2020-05-11 11:28 UTC (permalink / raw)
To: Yan, Zheng, ceph-devel
On Mon, 2020-05-11 at 16:25 +0800, Yan, Zheng wrote:
> 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;
> }
>
> /*
Good catch! Merged (with a small revision to the commit message).
--
Jeff Layton <jlayton@kernel.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-05-11 11:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-11 8:25 [PATCH] ceph: properly wake up cap waiter after releasing revoked caps Yan, Zheng
2020-05-11 11:28 ` Jeff Layton
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.