lkml.org 
[lkml]   [2021]   [Dec]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -next V3] ubi: fix race condition between ctrl_cdev_ioctl and ubi_cdev_ioctl
----- Ursprüngliche Mail -----
> Von: "chengzhihao1" <chengzhihao1@huawei.com>
> kernfs_drain() will wait 'root->deactivate_waitq' if
> atomic_read(&kn->active) not equals to KN_DEACTIVATED_BIAS.
>
> The UBI seq_show callback is invoked with avtive cnt taken:
> vfs_read
> kernfs_fop_read_iter
> seq_read_iter
> m->op->start (kernfs_seq_start) // kernfs_get_active(of->kn)
> kernfs_seq_show
> dev_attribute_show [ubi]
> m->op->stop (kernfs_seq_stop) // kernfs_put_active(of->kn)
>
> The kernfs_drain() is stuck at wait_event() until sysfs reading
> finished, in my local test.

You are right. This means UBI does this extra check in vain.
Maybe even since ever.

Thanks,
//richard

\
 
 \ /
  Last update: 2021-12-30 22:32    [W:0.071 / U:0.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site