On 4/21/22 10:02 PM, David Howells wrote: > Jeffle Xu <jeffl...@linux.alibaba.com> wrote: > >> + struct kref unbind_pincount;/* refcount to do >> daemon unbind */ > > Please use refcount_t or atomic_t, especially as this isn't the refcount for > the structure. Okay, will be done in the next version. > >> - cachefiles_daemon_unbind(cache); >> - >> /* clean up the control file interface */ >> cache->cachefilesd = NULL; >> file->private_data = NULL; >> cachefiles_open = 0; > > Please call cachefiles_daemon_unbind() before the cleanup. Since the cachefiles_struct struct will be freed once the pincount is decreased to 0, "cache->cachefilesd = NULL;" needs to be done before decreasing the pincount. BTW, "cachefiles_open = 0;" indeed should be done only when pincount has been decreased to 0. -- Thanks, Jeffle -- Linux-cachefs mailing list Linux-cachefs@redhat.com https://listman.redhat.com/mailman/listinfo/linux-cachefs
- [Linux-cachefs] [PATCH v9 12/21] erofs: add fscache context ... Jeffle Xu
- [Linux-cachefs] [PATCH v9 21/21] erofs: add 'fsid' mount opt... Jeffle Xu
- [Linux-cachefs] [PATCH v9 19/21] erofs: implement fscache-ba... Jeffle Xu
- Re: [Linux-cachefs] [PATCH v9 00/21] fscache, erofs: fscache... JiaZhu
- Re: [Linux-cachefs] [PATCH v9 01/21] cachefiles: extract wri... David Howells
- Re: [Linux-cachefs] [PATCH v9 02/21] cachefiles: notify user... David Howells
- Re: [Linux-cachefs] [PATCH v9 03/21] cachefiles: unbind cach... David Howells
- Re: [Linux-cachefs] [PATCH v9 03/21] cachefiles: unbind... JeffleXu
- Re: [Linux-cachefs] [PATCH v9 04/21] cachefiles: notify user... David Howells
- Re: [Linux-cachefs] [PATCH v9 05/21] cachefiles: implement o... David Howells
- Re: [Linux-cachefs] [PATCH v9 06/21] cachefiles: enable on-d... David Howells
- Re: [Linux-cachefs] [PATCH v9 07/21] cachefiles: add tracepo... David Howells
- Re: [Linux-cachefs] [PATCH v9 08/21] cachefiles: document on... David Howells
- [Linux-cachefs] EMFILE/ENFILE mitigation needed in erofs? David Howells