ceph: remove request from waiting list before unregister
diff mbox series

Message ID 20190614025903.21540-1-zyan@redhat.com
State New
Headers show
Series
  • ceph: remove request from waiting list before unregister
Related show

Commit Message

Yan, Zheng June 14, 2019, 2:59 a.m. UTC
Link: https://tracker.ceph.com/issues/40339
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
---
 fs/ceph/mds_client.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Jeff Layton June 14, 2019, 11:32 a.m. UTC | #1
On Fri, 2019-06-14 at 10:59 +0800, Yan, Zheng wrote:
> Link: https://tracker.ceph.com/issues/40339
> Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
> ---
>  fs/ceph/mds_client.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
> index fda621bc8a29..776c47bd1155 100644
> --- a/fs/ceph/mds_client.c
> +++ b/fs/ceph/mds_client.c
> @@ -4162,6 +4162,7 @@ static void wait_requests(struct ceph_mds_client *mdsc)
>  		while ((req = __get_oldest_req(mdsc))) {
>  			dout("wait_requests timed out on tid %llu\n",
>  			     req->r_tid);
> +			list_del_init(&req->r_wait);
>  			__unregister_request(mdsc, req);
>  		}
>  	}

It might also be a good idea to add something like this to
ceph_mdsc_release_request:

     WARN_ON_ONCE(!list_empty(&req->r_wait))

...ditto for any of the other list_heads that we expect to be empty
before freeing. In any case:

Reviewed-by: Jeff Layton <jlayton@redhat.com>

Patch
diff mbox series

diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index fda621bc8a29..776c47bd1155 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -4162,6 +4162,7 @@  static void wait_requests(struct ceph_mds_client *mdsc)
 		while ((req = __get_oldest_req(mdsc))) {
 			dout("wait_requests timed out on tid %llu\n",
 			     req->r_tid);
+			list_del_init(&req->r_wait);
 			__unregister_request(mdsc, req);
 		}
 	}