lkml.org 
[lkml]   [2022]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] binderfs: rework superblock destruction
On Wed, Aug 17, 2022 at 03:03:06PM +0200, Christian Brauner wrote:

> +static void binderfs_kill_super(struct super_block *sb)
> +{
> + struct binderfs_info *info = sb->s_fs_info;
> +
> + if (info && info->ipc_ns)
> + put_ipc_ns(info->ipc_ns);
> +
> + kfree(info);
> + kill_litter_super(sb);
> +}

Other way round, please - shut the superblock down, *then*
free the objects it'd been using. IOW,

struct binderfs_info *info = sb->s_fs_info;

kill_litter_super(sb);

if (info && info->ipc_ns)
put_ipc_ns(info->ipc_ns);

kfree(info);

\
 
 \ /
  Last update: 2022-08-17 16:00    [W:0.117 / U:0.456 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site