mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: JeffleXu <jefflexu@linux.alibaba.com>
To: Jia Zhu <zhujia.zj@bytedance.com>, linux-erofs@lists.ozlabs.org
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	yinxin.x@bytedance.com
Subject: Re: [PATCH V4 2/6] erofs: code clean up for fscache
Date: Fri, 16 Sep 2022 10:02:06 +0800	[thread overview]
Message-ID: <cf7c0f78-abaa-de56-3809-17c510018ed5@linux.alibaba.com> (raw)
In-Reply-To: <20220915124213.25767-3-zhujia.zj@bytedance.com>



On 9/15/22 8:42 PM, Jia Zhu wrote:

> @@ -502,12 +493,19 @@ int erofs_fscache_register_fs(struct super_block *sb)
>  	volume = fscache_acquire_volume(name, NULL, NULL, 0);
>  	if (IS_ERR_OR_NULL(volume)) {
>  		erofs_err(sb, "failed to register volume for %s", name);
> -		ret = volume ? PTR_ERR(volume) : -EOPNOTSUPP;
> -		volume = NULL;
> +		kfree(name);
> +		return volume ? PTR_ERR(volume) : -EOPNOTSUPP;
>  	}
>  
>  	sbi->volume = volume;
>  	kfree(name);
> +
> +	fscache = erofs_fscache_register_cookie(sb, sbi->opt.fsid, true);
> +	/* acquired volume will be relinquished in kill_sb() */
> +	if (IS_ERR(fscache))
> +		return PTR_ERR(fscache);
> +
> +	sbi->s_fscache = fscache;
>  	return ret;

The local variable "ret" is not used in this case.


> @@ -889,7 +885,6 @@ static void erofs_kill_sb(struct super_block *sb)
>  
>  	erofs_free_dev_context(sbi->devs);
>  	fs_put_dax(sbi->dax_dev, NULL);
> -	erofs_fscache_unregister_cookie(&sbi->s_fscache);
>  	erofs_fscache_unregister_fs(sb);
>  	kfree(sbi->opt.fsid);
>  	kfree(sbi);
> @@ -909,7 +904,8 @@ static void erofs_put_super(struct super_block *sb)
>  	iput(sbi->managed_cache);
>  	sbi->managed_cache = NULL;
>  #endif
> -	erofs_fscache_unregister_cookie(&sbi->s_fscache);
> +	erofs_fscache_unregister_fs(sb);

> +	sbi->s_fscache = NULL;

This line is not needed since we already call
erofs_fscache_unregister_fs() here.


With these fixed:
Reviewed-by: Jingbo Xu <jefflexu@linux.alibaba.com>

-- 
Thanks,
Jingbo

  reply	other threads:[~2022-09-16  2:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-15 12:42 [PATCH V4 0/6] Introduce erofs shared domain Jia Zhu
2022-09-15 12:42 ` [PATCH V4 1/6] erofs: use kill_anon_super() to kill super in fscache mode Jia Zhu
2022-09-16  1:43   ` JeffleXu
2022-09-15 12:42 ` [PATCH V4 2/6] erofs: code clean up for fscache Jia Zhu
2022-09-16  2:02   ` JeffleXu [this message]
2022-09-15 12:42 ` [PATCH V4 3/6] erofs: introduce fscache-based domain Jia Zhu
2022-09-16  2:35   ` JeffleXu
2022-09-16  2:57   ` JeffleXu
2022-09-15 12:42 ` [PATCH V4 4/6] erofs: introduce a pseudo mnt to manage shared cookies Jia Zhu
2022-09-16  3:19   ` JeffleXu
2022-09-15 12:42 ` [PATCH V4 5/6] erofs: Support sharing cookies in the same domain Jia Zhu
2022-09-16  3:45   ` JeffleXu
2022-09-15 12:42 ` [PATCH V4 6/6] erofs: introduce 'domain_id' mount option Jia Zhu
2022-09-16  5:10   ` JeffleXu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cf7c0f78-abaa-de56-3809-17c510018ed5@linux.alibaba.com \
    --to=jefflexu@linux.alibaba.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yinxin.x@bytedance.com \
    --cc=zhujia.zj@bytedance.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®