lkml.org 
[lkml]   [2009]   [May]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 04/20] sysfs: Handle the general case of removing of directories with subdirectories
On Sat, May 23, 2009 at 22:09, Eric W. Biederman <ebiederm@xmission.com> wrote:
> Kay Sievers <kay.sievers@vrfy.org> writes:
>> What's the problem in /sys/dev/? There are just a bunch of symlinks,
>> one for every device with a dev_t, and all in flat directories, and no
>> directory to remove.
>
> device_shutdown called during reboot removes /sys/dev/block and /sys/dev/char.
> The current sysfs_remove_dir (because it empties directories)
> removes all of those symlinks.
>
> The problem is that it is the device objects for each individual
> device that owns those symlinks, and normally removes those symlinks.
>
> Which means that in theory we could have double deletion going on.
>
> In practice today it doesn't matter because this is at reboot.
>
> And as far as that goes it is wrong to remove anything from sysfs during
> device_shutdown so the fix is just to not call kobject_put there.

Yes, that's just a bug. These directories should never be removed.

Thanks,
Kay


\
 
 \ /
  Last update: 2009-05-23 22:51    [W:0.149 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site