* [v2] ceph: if we are blacklisted, __do_request returns directly
@ 2020-04-17 9:36 Yanhu Cao
2020-04-17 10:41 ` Jeff Layton
0 siblings, 1 reply; 3+ messages in thread
From: Yanhu Cao @ 2020-04-17 9:36 UTC (permalink / raw)
To: jlayton; +Cc: sage, idryomov, ceph-devel, linux-kernel, Yanhu Cao
If we mount cephfs by the recover_session option,
__do_request can return directly until the client automatically reconnects.
Signed-off-by: Yanhu Cao <gmayyyha@gmail.com>
---
fs/ceph/mds_client.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index 486f91f9685b..e6cda256b136 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -2708,6 +2708,12 @@ static void __do_request(struct ceph_mds_client *mdsc,
put_request_session(req);
+ if (mdsc->fsc->blacklisted &&
+ ceph_test_mount_opt(mdsc->fsc, CLEANRECOVER)) {
+ err = -EACCES;
+ goto finish;
+ }
+
mds = __choose_mds(mdsc, req, &random);
if (mds < 0 ||
ceph_mdsmap_get_state(mdsc->mdsmap, mds) < CEPH_MDS_STATE_ACTIVE) {
--
2.24.2 (Apple Git-127)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [v2] ceph: if we are blacklisted, __do_request returns directly
2020-04-17 9:36 [v2] ceph: if we are blacklisted, __do_request returns directly Yanhu Cao
@ 2020-04-17 10:41 ` Jeff Layton
2020-04-17 11:03 ` Yanhu Cao
0 siblings, 1 reply; 3+ messages in thread
From: Jeff Layton @ 2020-04-17 10:41 UTC (permalink / raw)
To: Yanhu Cao; +Cc: sage, idryomov, ceph-devel, linux-kernel
On Fri, 2020-04-17 at 17:36 +0800, Yanhu Cao wrote:
> If we mount cephfs by the recover_session option,
> __do_request can return directly until the client automatically reconnects.
>
> Signed-off-by: Yanhu Cao <gmayyyha@gmail.com>
> ---
> fs/ceph/mds_client.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
> index 486f91f9685b..e6cda256b136 100644
> --- a/fs/ceph/mds_client.c
> +++ b/fs/ceph/mds_client.c
> @@ -2708,6 +2708,12 @@ static void __do_request(struct ceph_mds_client *mdsc,
>
> put_request_session(req);
>
> + if (mdsc->fsc->blacklisted &&
> + ceph_test_mount_opt(mdsc->fsc, CLEANRECOVER)) {
> + err = -EACCES;
> + goto finish;
> + }
> +
> mds = __choose_mds(mdsc, req, &random);
> if (mds < 0 ||
> ceph_mdsmap_get_state(mdsc->mdsmap, mds) < CEPH_MDS_STATE_ACTIVE) {
We do have an EBLACKLISTED error defined, which is the same as
ESHUTDOWN. The read and write code can return that when the client is
blacklisted. Same for cap handling (in __ceph_pool_perm_get. Should this
return -EBLACKLISTED instead?
--
Jeff Layton <jlayton@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [v2] ceph: if we are blacklisted, __do_request returns directly
2020-04-17 10:41 ` Jeff Layton
@ 2020-04-17 11:03 ` Yanhu Cao
0 siblings, 0 replies; 3+ messages in thread
From: Yanhu Cao @ 2020-04-17 11:03 UTC (permalink / raw)
To: Jeff Layton; +Cc: Sage Weil, Ilya Dryomov, ceph-devel, LKML
Yeah, patch the next commit.
On Fri, Apr 17, 2020 at 6:41 PM Jeff Layton <jlayton@kernel.org> wrote:
>
> On Fri, 2020-04-17 at 17:36 +0800, Yanhu Cao wrote:
> > If we mount cephfs by the recover_session option,
> > __do_request can return directly until the client automatically reconnects.
> >
> > Signed-off-by: Yanhu Cao <gmayyyha@gmail.com>
> > ---
> > fs/ceph/mds_client.c | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> > diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
> > index 486f91f9685b..e6cda256b136 100644
> > --- a/fs/ceph/mds_client.c
> > +++ b/fs/ceph/mds_client.c
> > @@ -2708,6 +2708,12 @@ static void __do_request(struct ceph_mds_client *mdsc,
> >
> > put_request_session(req);
> >
> > + if (mdsc->fsc->blacklisted &&
> > + ceph_test_mount_opt(mdsc->fsc, CLEANRECOVER)) {
> > + err = -EACCES;
> > + goto finish;
> > + }
> > +
> > mds = __choose_mds(mdsc, req, &random);
> > if (mds < 0 ||
> > ceph_mdsmap_get_state(mdsc->mdsmap, mds) < CEPH_MDS_STATE_ACTIVE) {
>
> We do have an EBLACKLISTED error defined, which is the same as
> ESHUTDOWN. The read and write code can return that when the client is
> blacklisted. Same for cap handling (in __ceph_pool_perm_get. Should this
> return -EBLACKLISTED instead?
>
> --
> Jeff Layton <jlayton@kernel.org>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-04-17 11:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-17 9:36 [v2] ceph: if we are blacklisted, __do_request returns directly Yanhu Cao
2020-04-17 10:41 ` Jeff Layton
2020-04-17 11:03 ` Yanhu Cao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®