[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a1543a27-7f52-266b-dd67-972902e80e8e@linux.alibaba.com>
Date: Mon, 21 Mar 2022 22:43:20 +0800
From: JeffleXu <jefflexu@...ux.alibaba.com>
To: David Howells <dhowells@...hat.com>
Cc: linux-cachefs@...hat.com, xiang@...nel.org, chao@...nel.org,
linux-erofs@...ts.ozlabs.org, torvalds@...ux-foundation.org,
gregkh@...uxfoundation.org, willy@...radead.org,
linux-fsdevel@...r.kernel.org, joseph.qi@...ux.alibaba.com,
bo.liu@...ux.alibaba.com, tao.peng@...ux.alibaba.com,
gerry@...ux.alibaba.com, eguan@...ux.alibaba.com,
linux-kernel@...r.kernel.org, luodaowen.backend@...edance.com
Subject: Re: [PATCH v5 04/22] cachefiles: notify user daemon with anon_fd when
looking up cookie
On 3/21/22 10:01 PM, David Howells wrote:
> Jeffle Xu <jefflexu@...ux.alibaba.com> wrote:
>
>> + read_lock(&cache->reqs_lock);
>> +
>> + /* recheck dead state under lock */
>> + if (test_bit(CACHEFILES_DEAD, &cache->flags)) {
>> + read_unlock(&cache->reqs_lock);
>> + ret = -EIO;
>> + goto out;
>> + }
>> +
>> + xa_lock(xa);
>> + ret = __xa_alloc(xa, &id, req, xa_limit_32b, GFP_KERNEL);
>
> You're holding a spinlock. You can't use GFP_KERNEL.
Oh yes... I've dropped into this for second time... Sorry for that.
>
>> +static int cachefiles_ondemand_cinit(struct cachefiles_cache *cache, char *args)
>> +{
>> ...
>> + tmp = kstrdup(args, GFP_KERNEL);
>
> No need to copy the string. The caller already did that and added a NUL for
> good measure.
Right.
>
> I would probably move most of the functions added in this patch to
> fs/cachefiles/ondemand.c.
Alright.
--
Thanks,
Jeffle
Powered by blists - more mailing lists