lkml.org 
[lkml]   [2022]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH v5 04/22] cachefiles: notify user daemon with anon_fd when looking up cookie
    Date
    Jeffle Xu <jefflexu@linux.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.

    > +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.

    I would probably move most of the functions added in this patch to
    fs/cachefiles/ondemand.c.

    David

    \
     
     \ /
      Last update: 2022-03-21 15:19    [W:5.371 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site