Skip to content

Commit 0704564

Browse files
lxbszidryomov
authored andcommitted
ceph: always check dir caps asynchronously
The MDS will issue the 'Fr' caps for async dirop, while there is buggy in kclient and it could miss releasing the async dirop caps, which is 'Fsxr'. And then the MDS will complain with: "[WRN] client.xxx isn't responding to mclientcaps(revoke) ..." So when releasing the dirop async requests or when they fail we should always make sure that being revoked caps could be released. Link: https://tracker.ceph.com/issues/50223 Signed-off-by: Xiubo Li <xiubli@redhat.com> Reviewed-by: Milind Changire <mchangir@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
1 parent cda4672 commit 0704564

File tree

4 files changed

+5
-14
lines changed

4 files changed

+5
-14
lines changed

fs/ceph/caps.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3216,7 +3216,6 @@ static int ceph_try_drop_cap_snap(struct ceph_inode_info *ci,
32163216

32173217
enum put_cap_refs_mode {
32183218
PUT_CAP_REFS_SYNC = 0,
3219-
PUT_CAP_REFS_NO_CHECK,
32203219
PUT_CAP_REFS_ASYNC,
32213220
};
32223221

@@ -3332,11 +3331,6 @@ void ceph_put_cap_refs_async(struct ceph_inode_info *ci, int had)
33323331
__ceph_put_cap_refs(ci, had, PUT_CAP_REFS_ASYNC);
33333332
}
33343333

3335-
void ceph_put_cap_refs_no_check_caps(struct ceph_inode_info *ci, int had)
3336-
{
3337-
__ceph_put_cap_refs(ci, had, PUT_CAP_REFS_NO_CHECK);
3338-
}
3339-
33403334
/*
33413335
* Release @nr WRBUFFER refs on dirty pages for the given @snapc snap
33423336
* context. Adjust per-snap dirty page accounting as appropriate.

fs/ceph/mds_client.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,7 +1089,7 @@ void ceph_mdsc_release_request(struct kref *kref)
10891089
struct ceph_mds_request *req = container_of(kref,
10901090
struct ceph_mds_request,
10911091
r_kref);
1092-
ceph_mdsc_release_dir_caps_no_check(req);
1092+
ceph_mdsc_release_dir_caps_async(req);
10931093
destroy_reply_info(&req->r_reply_info);
10941094
if (req->r_request)
10951095
ceph_msg_put(req->r_request);
@@ -4261,16 +4261,15 @@ void ceph_mdsc_release_dir_caps(struct ceph_mds_request *req)
42614261
}
42624262
}
42634263

4264-
void ceph_mdsc_release_dir_caps_no_check(struct ceph_mds_request *req)
4264+
void ceph_mdsc_release_dir_caps_async(struct ceph_mds_request *req)
42654265
{
42664266
struct ceph_client *cl = req->r_mdsc->fsc->client;
42674267
int dcaps;
42684268

42694269
dcaps = xchg(&req->r_dir_caps, 0);
42704270
if (dcaps) {
42714271
doutc(cl, "releasing r_dir_caps=%s\n", ceph_cap_string(dcaps));
4272-
ceph_put_cap_refs_no_check_caps(ceph_inode(req->r_parent),
4273-
dcaps);
4272+
ceph_put_cap_refs_async(ceph_inode(req->r_parent), dcaps);
42744273
}
42754274
}
42764275

@@ -4306,7 +4305,7 @@ static void replay_unsafe_requests(struct ceph_mds_client *mdsc,
43064305
if (req->r_session->s_mds != session->s_mds)
43074306
continue;
43084307

4309-
ceph_mdsc_release_dir_caps_no_check(req);
4308+
ceph_mdsc_release_dir_caps_async(req);
43104309

43114310
__send_request(session, req, true);
43124311
}

fs/ceph/mds_client.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ extern int ceph_mdsc_do_request(struct ceph_mds_client *mdsc,
552552
struct inode *dir,
553553
struct ceph_mds_request *req);
554554
extern void ceph_mdsc_release_dir_caps(struct ceph_mds_request *req);
555-
extern void ceph_mdsc_release_dir_caps_no_check(struct ceph_mds_request *req);
555+
extern void ceph_mdsc_release_dir_caps_async(struct ceph_mds_request *req);
556556
static inline void ceph_mdsc_get_request(struct ceph_mds_request *req)
557557
{
558558
kref_get(&req->r_kref);

fs/ceph/super.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,8 +1255,6 @@ extern void ceph_take_cap_refs(struct ceph_inode_info *ci, int caps,
12551255
extern void ceph_get_cap_refs(struct ceph_inode_info *ci, int caps);
12561256
extern void ceph_put_cap_refs(struct ceph_inode_info *ci, int had);
12571257
extern void ceph_put_cap_refs_async(struct ceph_inode_info *ci, int had);
1258-
extern void ceph_put_cap_refs_no_check_caps(struct ceph_inode_info *ci,
1259-
int had);
12601258
extern void ceph_put_wrbuffer_cap_refs(struct ceph_inode_info *ci, int nr,
12611259
struct ceph_snap_context *snapc);
12621260
extern void __ceph_remove_capsnap(struct inode *inode,

0 commit comments

Comments
 (0)