Hello, Bart.

On Thu, Jul 26, 2018 at 09:57:40PM +0000, Bart Van Assche wrote:
...
> @@ -440,11 +445,21 @@ bool sysfs_remove_file_self(struct kobject *kobj, const 
> struct attribute *attr)
>               return false;
>  
>       ret = kernfs_remove_self(kn);
> +     if (ret && cb) {
> +             kernfs_break_active_protection(kn);
> +             cb(kobj, attr, data);
> +             kernfs_break_active_protection(kn);

unbreak?

Also, wouldn't it be better to just expose sysfs_break/unbreak and
then do sth like the following from scsi?

        kobject_get();
        sysfs_break_active_protection();
        do normal sysfs removal;
        sysfs_unbreak..();
        kobject_put();

Thanks.

-- 
tejun

Reply via email to