From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98B0FC54EE9 for ; Fri, 16 Sep 2022 09:29:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230109AbiIPJ3Z (ORCPT ); Fri, 16 Sep 2022 05:29:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229849AbiIPJ3X (ORCPT ); Fri, 16 Sep 2022 05:29:23 -0400 Received: from out30-57.freemail.mail.aliyun.com (out30-57.freemail.mail.aliyun.com [115.124.30.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B4F3A59AA; Fri, 16 Sep 2022 02:29:21 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R931e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046051;MF=jefflexu@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0VPwiYrC_1663320557; Received: from 30.221.130.67(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0VPwiYrC_1663320557) by smtp.aliyun-inc.com; Fri, 16 Sep 2022 17:29:18 +0800 Message-ID: <1b1222b8-4511-dfd4-bbd2-f354dc2cc5a9@linux.alibaba.com> Date: Fri, 16 Sep 2022 17:29:17 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH V5 5/6] erofs: Support sharing cookies in the same domain Content-Language: en-US To: Jia Zhu , linux-erofs@lists.ozlabs.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, yinxin.x@bytedance.com References: <20220916085940.89392-1-zhujia.zj@bytedance.com> <20220916085940.89392-6-zhujia.zj@bytedance.com> From: JeffleXu In-Reply-To: <20220916085940.89392-6-zhujia.zj@bytedance.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/16/22 4:59 PM, Jia Zhu wrote: > +static > +struct erofs_fscache *erofs_fscache_domain_init_cookie(struct super_block *sb, > + char *name, bool need_inode) > +{ > + int err; > + struct inode *inode; > + struct erofs_fscache *ctx; > + struct erofs_domain *domain = EROFS_SB(sb)->domain; > + > + ctx = erofs_fscache_acquire_cookie(sb, name, need_inode); > + if (IS_ERR(ctx)) > + return ctx; > + > + ctx->name = kstrdup(name, GFP_KERNEL); > + if (!ctx->name) { > + err = -ENOMEM; > + goto out; > + } > + > + inode = new_inode(erofs_pseudo_mnt->mnt_sb); > + if (!inode) { > + kfree(ctx->name); ^ This line can be omitted since erofs_fscache_relinquish_cookie() will be called. > + err = -ENOMEM; > + goto out; > + } > + > + ctx->domain = domain; > + ctx->anon_inode = inode; > + inode->i_private = ctx; > + refcount_inc(&domain->ref); > + return ctx; > +out: > + erofs_fscache_relinquish_cookie(ctx); > + return ERR_PTR(err); > +} Otherwise LGTM. Reviewed-by: Jingbo Xu -- Thanks, Jingbo